Reputation: 403
What I'm looking to do is rewrite the url so that one of the directories are hidden. For example;
http://www.example.com/home/example.html
to
http://www.example.com/example.html
As I'm new to .htaccess and mod_rewrite, is this something that can be done?
Upvotes: 0
Views: 53
Reputation: 7525
This should work:
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/home/.*$
RewriteRule ^(.*)$ /home/$1 [L]
Upvotes: 1
Reputation: 203
Something like this should work.
RewriteEngine On # Turn on the rewriting engine
RewriteRule ^example.html$ /home/example.html [NC,L]
Upvotes: 0