Creare / WP-htaccess

Wordpress .htaccess Boilerplate
86 stars 49 forks source link

WP in subfolder: Redirect loop #2

Open M-Willett opened 11 years ago

M-Willett commented 11 years ago

Had an issue with this .htaccess causing a redirect loop, just adding the subfolder name wasn't working, the following fixed:

# BEGIN WordPress

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]

    # add a trailing slash to /wp-admin
    RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]

    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
    RewriteRule . index.php [L]
</IfModule>

# END WordPress
bavington commented 11 years ago

Hi Matt, thanks for sharing the feedback. So were you getting a redirect loop on the whole site, or just the back-end?

M-Willett commented 11 years ago

It was the whole site. However I've just tried to replicate and it's working fine, without adding any directory info. Strange.