Reputation: 15506
Dear folks, How to setup a proper APACHE rule in .Htaccess on shared hosting to get this Condition and Rule working:
RewriteCond ...
RewriteRule ...
Where...
Condition = If the browser url contains any directory equal to (one|two|three)
which are forbidden directories, then...
Rule = do not load any pages there, instead: 301 to the relative root /
... that way loading effectively the main domain name, whatever that domain may be. So: once again: I don't want to to use hard coded absolute domain name, just relative root (or erase the entire relative url that would be same as going to the root right?)
Thank you very much for your suggestion.
Upvotes: 1
Views: 2863
Reputation: 54445
Something along the lines of...
RewriteEngine on
RewriteCond %{REQUEST_URI} ^/one/
RewriteCond %{REQUEST_URI} ^/two/
RewriteCond %{REQUEST_URI} ^/three/
RewriteRule (.*) http://www.yourdomain.com [R=301,L]
...should do it.
Upvotes: 3