Reputation: 1111
I am using htaccess on localhost, my htaccess is:
RewriteEngine On
RewriteBase /website/files/
RewriteRule ^home/?$ home.php [NC]
RewriteRule ^page/?$ page.php [NC]
This url works:
http://localhost/website/files/home
But when hovering over links on the page they are displayed as:
http://localhost/page
Instead of:
http://localhost/website/files/page
All links in the page are set as:
<a href="/page">page</a>
How can I prepend the directory to all urls in htaccess?
Upvotes: 1
Views: 400
Reputation: 785128
Create this .htaccess in the site root .htaccess:
RewriteEngine On
RewriteRule .* website/files/$0 [L]
Keep your website/files/.htaccess
as you've shown in question.
Upvotes: 0