Welcome to WebmasterWorld Guest from

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

index.html to "/" redirect issue w/ wordpress, mysql

redirect not allowing me to access web based admin interfaces

5:09 pm on Jul 14, 2008 (gmt 0)

Junior Member

5+ Year Member

joined:June 12, 2006
posts: 72
votes: 0

I am posting after searching the archives and not finding an answer. I apologize if I missed a previous post.

I have been running the following htaccess code successfully for years; however, the index.html to site.com/ portion is causing a 403 forbidden error when trying to access mysql and wordpress interfaces on the site account. I believe it is because the htaccess is redirecting ALL index.html which may also be the name of the admin pages for such web based interfaces for wordpress, etc?

Has anyone ever experienced this? Is there a way to specify site.com/index.html get redirected, and not just /index.html?

Here is the current code:
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]+/)*index\.html\ HTTP/
RewriteRule ^(([^/]+/)*)index\.html$ [site.com...] [R=301,L]
RewriteCond %{HTTP_HOST} ^site.com [NC]
RewriteRule ^(.*)$ [site.com...] [L,R=301]

I have tried to change it to no avail. I removed 'DirectoryIndex index.html' to prevent looping. Any help would be greatly appreciated.


7:12 pm on July 14, 2008 (gmt 0)

Senior Member

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Mar 31, 2002
votes: 0

All you need to do is add exclusions to your "index rewrite" rule, such as

RewriteCond %{REQUEST_URI} !^/mysql-admin-directory/
RewriteCond %{REQUEST_URI} !^/wp-admin-directory/

with the correct directory URL-paths substituted into those lines. All index files in and under those directories will then be excluded from being rewritten.

See the Apache mod_rewrite documentation for more info.