I have a project in a subfolder of my xampp root (rootFolder/myProjectName). Ok. But I'm using friendly URLs. So, whenever I want to link a JS or CSS file, for example, if I set:
<script type="text/javascript" src="/script.js"></script>
This is pointing to rootFolder/script.js not rootFolder/myProjectName/script.js!
Ok! I could add manually.. But, later, if I change my project to another folder or even to the root, I'd to change one by one!
How can I set the base folder of my project as "myProjectName" using htaccess (Or, if there is a better way..).
My htaccess is currently like this:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [QSA,L]
This is because I'm using the "index.php" to route! But there are some pages called outside (http://localhost/myProjectName/html/pageName) and I cant get scripts to find their way without setting "[src="**myProjectName/**script.js"] manually!