Hi again.
On the other recipe richardk gave me for
subdomains.domain.tld -> /subsites/subdomains
and also to work with WordpressMu (which works prety fine) I decided to add this rule above -- hopefully well inserted so when the user goes to:
http://(.*)healthblogs.org/wp-admin/(.*) is automaticaly redirected to
https://(.*)healthblogs.org/wp-admin/(.*)
And that is the *problem*
If you go to
http://healthblogs.org/wp-admin/ you will end up with an error at
https://www.healthblogs.org/wp-admin/ (not now because I had to comment the rules).
Before the insertion of this rule I go to any address in that domain with http or https without problems.
The code:
- Code: Select all
Options +FollowSymLinks
<IfModule mod_rewrite.c>
RewriteEngine On
#RewriteBase /
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
#RewriteCond %{HTTPS} =on
RewriteCond %{SERVER_PORT} =443
RewriteCond %{REQUEST_URI} !\.(js|css|jpe?g|png|bmp|gif|php)$ [NC]
RewriteRule !^wp-admin(/.*)?$ http://%{SERVER_NAME}% [R=301,L]
#RewriteCond %{HTTP} =on
RewriteCond %{SERVER_PORT} =80
RewriteRule ^wp-admin(/.*)?$ https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]
RewriteRule ^(stats(/.*)?|failed_auth\.html)$ - [NC,L]
RewriteCond %{HTTP_HOST} ^([^\.]+)\.healthblogs.org$ [NC]
RewriteCond %{DOCUMENT_ROOT}/subsites/%1%{REQUEST_URI}/ -d
RewriteRule [^/]$ %{REQUEST_URI}/ [R=301,L]
RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteCond %{HTTP_HOST} ^([^\.]+)\.healthblogs.org$ [NC]
RewriteCond %{DOCUMENT_ROOT}/subsites/%1/ -d
RewriteRule ^(.*)$ /subsites/%1/$1 [QSA,L]
RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteCond %{REQUEST_URI} ^/([^/]+)(/(.*))?$
RewriteCond %{DOCUMENT_ROOT}/subsites/%1/ -d
RewriteRule .* http://%1.healthblogs.org/%3 [R=301,L]
RewriteRule ^(.*/)?files/(.*)$ /wp-content/blogs.php?file=$2 [L]
RewriteCond %{ENV:REDIRECT_STATUS} !^$ [OR]
RewriteCond %{SCRIPT_FILENAME} -f [OR]
RewriteCond %{SCRIPT_FILENAME} -d
RewriteRule . - [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-.*|.*\.php)$ $2 [L]
RewriteRule . index.php [L]
</IfModule>
Any ideia of what am i doing wrong?
Thanks a lot.