Drupal: how rewrite all urls so that the instal directory isn't included in the link
I installed drupal on my site at say, example.co.uk/portfolio
.
All the links are showing as example.co.uk/portfolio/project-1
.
I want it to be example.co.uk/project-1
How can I use rewrite rules or whatever so that wherever there is a link that has the /portfolio
directory showing, that it will not show it in the href at all? I want to be able to hide that the site is installed in a directory and want it to show everything from the root url www.example.co.uk/
So far,
I've messed around with RewriteBase /
and also mapping the portfolio t开发者_如何学运维o the main root via:
RewriteRule ^/?$ /portfolio
Try this mod_rewrite rule in the .htaccess file in your root directory:
RewriteEngine on
RewriteRule !^portfolio/ portfolio%{REQUEST_URI}
精彩评论