Forum Moderators: phranque
RewriteRule ^search/(.*)$ https://search.domain.com/$1 [R=301,L] --> this doesn't work infinite looping
RewriteCond %{HTTP_HOST} !^search.domain.com$
RewriteCond %{HTTP_HOST} !^images.domain.com$
RewriteCond %{HTTP_HOST} !^css.domain.com$
RewriteCond %{HTTP_HOST} !^www.domain.com$
RewriteRule ^(.*) https://www.domain.com/$1 [L,R=301]
RewriteRule ^photos/originals/([0-9]+)_1\.jpg$ https://www.domain.com/photos/$1/$1_l.jpg [R=301,L]
[edited by: phranque at 12:43 am (utc) on Dec 19, 2017]
[edit reason] unlinked urls [/edit]
this doesn't work infinite looping
https://www.domain.com/originals/123_1.jpg (301 to) --> https://www.domain.com/photos/123/123_l.jpg
[edited by: phranque at 3:02 am (utc) on Dec 19, 2017]
[edit reason] unlinked urls [/edit]
i don't see a rule that would redirect /originals/ to /photos/
RewriteRule ^photos/originals/([0-9]+)_1\.jpg$ https://www.domain.com/photos/$1/$1_l.jpg [R=301,L]It redirects /photos/originals/blahblah to /photos/modified-blahblah/blahblah with a newly added subdirectory replacing /originals/ RewriteCond %{HTTP_HOST} !^search.example.com$
RewriteCond %{HTTP_HOST} !^images.example.com$
RewriteCond %{HTTP_HOST} !^css.example.com$
RewriteCond %{HTTP_HOST} !^www.example.com$
RewriteRule ^(.*) https://www.example.com/$1 [L,R=301]This can all be collapsed to RewriteCond %{HTTP_HOST} !^(search|images|css|www)\.example\.com$
RewriteRule ^(.*) https://www.example.com/$1 [L,R=301]... except I don't think this rule will do exactly what you want it to. You need two rules: one for (search|css|images) non-HTTPS to HTTPS, and another one for all other incorrect host and/or protocol to https://www.example.com/etcetera. i don't see a rule that would redirect /originals/ to /photos/
It's this one, isn't it?It redirects /photos/originals/blahblah to /photos/modified-blahblah/blahblah with a newly added subdirectory replacing /originals/RewriteRule ^photos/originals/([0-9]+)_1\.jpg$ https://www.domain.com/photos/$1/$1_l.jpg [R=301,L]
http://www.domain.com/originals/123_1.jpg
[edited by: phranque at 4:52 am (utc) on Dec 19, 2017]
if I load https://www.domain.com/search/1244/several-words redirect continuosly to https://search.domain.com/1244/several-words although it is the correct url.
How can I check if is noncanonical or it's a non-https request?
RewriteCond %{HTTP_HOST} !^(www\.example\.com)?$ [OR]
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://www.example.com/$1 [L,R=301]