after setting up the wordpress htaccess rules in my vhost, i was unable to enter the wp-admin area. I was always redirected to the frontpage of my wordpress instance.
The rewriting itself worked on the mainpage. All links worked so far, but the admin area remains without any access.
Rewrite rules used:
RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
Personally i dont know where to start looking, im even unable to find that problem over google, which is kinda rare – maybe someone over here knows where the problem is to be located.
I’m not sure if this helps but its good practice, include the BEGIN and END WordPress comments around your rules as well as the check for mod_rewrite:
Also:
OK, so the initial Problem was:
How to get the Rewrite Rule working at a VHOST Environment
and the answer – if unknown – was a little tricky. RewriteBase doesn’t work on a VHOST. The Solution is to put all those Rewrite-Stuff at a Directory-Section like this:Then it works. I’ll be updating the questions title for better google results in the future. Hope this may help anyone running into the same troubles.
I’m using the following in my vhost configuration, with this you can use the .htaccess file in your project directory: