Reputation: 3
I have a main php file and in which i am doing all the stuff related to my website.
I have edited .htaccess file as follow to rewrite the URL
RewriteEngine On
RewriteBase /test/
RewriteRule /(.*)-(.*)/$ index.php?uds=$1&vid=$2
I have created separate file for JS & CSS (PHP only) and for footer JS (PHP). Now, I'm including this JS and CSS PHP files in my index.php file.
But the problem is in the footer.php and header.php files, I have to give ../../css/bootstraph.css path.
Is there a solution by which I don't have to update this header and footer.php files?
Upvotes: 0
Views: 206
Reputation: 76
There is not enough information in your post, but if the problem is in providing correct pathes to different scripts/styles after URL has been rewrited - then I suggest to simply use:
<base href="http://www.your-website.com/">
in the document's HEAD section. So, it would be no matter if you load the page, for example, your-site.com/page1 or your-site.com/section1/subsection/page12345 - all pathes to scripts/styles would be equal.
Upvotes: 1