homepage Welcome to WebmasterWorld Guest from 54.204.127.191
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Visit PubCon.com
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
Gshaughn




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

Hello,
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.

Thanks!
Greg

 

jdMorgan




msg:3698231
 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.

Jim

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