I have a problem I need help solving. I have a web server that I need to rewrite the URL's. Here is what I have in my .htaccess in my webroot directory
Quote:
#Force www in URL
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www.example.com$
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301]
#End force www in url
|
This works works well until someone enters this for example;
http://example.com/subdirectory
So these are my questions:
1. How can I force this rule to apply to all subdirectories?
2. I want to retain some content there that I can access via IP, is there a way to make it ignore requests that have been made through IP ? e.g
http://1.2.3.4 should not be caught by the rule.
I tried to read around but I'm not quite effective with regex yet. Please point me in the right direction.