I need some extra code in my .htaccess
file that configures this HTTP request for HTTPS too!
<ifmodule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(.*)\.example\.com
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI}/sponsor/%1/$1 [L,NC,QSA]
Options +FollowSymlinks
</ifmodule>
My problem: now it gets the /sponsor
tag only if I type the example with http:
GOOD:
- This is working:
http://subdomain.example.com
results inhttp://subdomain.example.com/sponsor/subdomain
.
BAD:
- This isn't working:
https://subdomain.example.com
results inhttps://subdomain.example.com/
.
I need a .htaccess
rewrite, that automatically puts the /sponsor
TAG into the HTTPS URLs too.
UPDATE: Here is my .htaccess
file:
# BEGIN WordPress
<IfModule mod_rewrite.c>
Options +FollowSymlinks
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(.*)\.example\.com [OR,NC]
RewriteCond https://%{HTTPS_HOST} ^(.*)\.example\.com [NC]
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI}/sponsor/%1/$1 [L,NC,QSA]
Options +FollowSymlinks
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
.htaccess
file. The code you posted would result in a "redirect loop" - so there would seem to be something else going on here? It also does not differentiate between HTTP and HTTPS, so again, something else is going on here if you are seeing a different response. The code you posted (even if it did "work") would not result in the "GOOD" redirect you've stated - so, yet again, something else is going on here.