mod-rewrite: what's wrong with this simple rewrite to redirect to a subdirectory?
- by Tom Auger
the root directory http: // www .mydomain .com (SF won't let me post hyperlinks - rep is too low) has a catchall index.php page in it, and an .htaccess file. Within this root directoy I have a wordpress/ directory which contains (suprise surprise) a wordpress installation.
My goal is that when the user types in http: // www .mydomain .com they are instead taken to http: // www .mydomain .com/wordpress
Here is my rewrite rule:
RewriteEngine on
RewriteCond %{REQUEST_URI} !^/wordpress
RewriteRule ^/(.*)$ http://%{SERVER_NAME}/wordpress/$1 [L]
At the moment it appears to do nothing - it still loads index.php within the root directory.
What should my rewrite rule be (I'm assuming the one I'm using is wrong)?