Forum Moderators: phranque
/home/example/public_html/happy/new/year/No ads
/home/example/public_html/niddlenaddlenoo/No ads Try thisBut that's just a Condition. What rule is it attached to? If you throw in a RewriteCond and forget to make the rule itself, the condition will be applied to the next RewriteRule, no matter what it is. (In Apache, unlike in robots.txt, blank lines have no syntactic significance.)
RewriteCond %{REQUEST_URI} (.+?)No\sads
RewriteRule No\sads$ https://www.example.com/%1 [R=301,L]
The idea here is that the act of capturing makes a teeny bit of extra work for the server--and 999 times out of 1000, it ends up having to throw away the capture when the request turns out not to have the "No ads" element after all. There's really no efficient way to do it; ^((\w+/])*) or ^(([\w-]+/])*) would be even more work to achieve the same result. So why not shift the capture to a condition. if anyone has more info...Another WebmasterWorld member sent me a log snippet with requests just like the one you describe. From this I learn:
AH00128: File does not exist: /home/EXAMPLE/public_html/https:/www.exa-mple.com/ https://www.exa-mple.com
Any gurus out there know the correct way to rewrite that
/home/EXAMPLE/public_html/https:/www.exa-mple.com/Is it really https:/ with just one slash, or did you mistype?
it's just annoying seeing lots of errors in the logsIn some respects, errors in logs are like the “errors” reported by GSC: Yes, OK, thank you, everything is happening exactly the way I want, now will you shut up about it already and stop calling everything an error.