user1563944
user1563944

Reputation: 403

Domain Url Rewrite

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

Answers (2)

Zak
Zak

Reputation: 7525

This should work:

RewriteEngine On
RewriteCond %{REQUEST_URI} !^/home/.*$ 
RewriteRule ^(.*)$ /home/$1 [L]

Upvotes: 1

user1884047
user1884047

Reputation: 203

Something like this should work.

RewriteEngine On    # Turn on the rewriting engine
RewriteRule    ^example.html$    /home/example.html    [NC,L]

Upvotes: 0

Related Questions