homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

index.html to "/" redirect issue w/ wordpress, mysql
redirect not allowing me to access web based admin interfaces

5+ Year Member

Msg#: 3698137 posted 5:09 pm on Jul 14, 2008 (gmt 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.




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

Msg#: 3698137 posted 7:12 pm on Jul 14, 2008 (gmt 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.


Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved