Forum Moderators: phranque
https://domain.com/https://www.domain.com/ukgs_logo/
https://domain.com/https://www.domain.com/ukgs_logo/
https://domain.com/https://www.domain.com/Each time I've seen this problem there was a conflict between a server redirect and account redirect.
what is a hostname canonicalisation?[
RewriteCond {HTTP_HOST} !^(www\.example\.com)?$ [NC,OR]
RewriteCond %{HTTPS} !on
RewriteRule ^(.*)$ https://www.example.com/$1 [L,R=301] server repsonse is:
...https://domain.com/https://www.domain.com/ukgs_logo/
with a 404 error
I have approx 40 urls with 301 statements such as
Redirect 301 /watches/ice/ /department/watches/
I have approx 40 urls with 301 statements40 of them? Then it's time to fire up a text editor that does Regular Expressions, make a copy of your htaccess file, and apply these global changes (replace \1 with $1 depending on your RegEx engine):
^Redirect(?:Match)? 301 /(.+)
TO
RewriteRule \1 [R=301,L]
^Redirect(?:Match)? 410 /(.+)
TO
RewriteRule \1 - [G]
^Redirect(?:Match)? 403 /(.+)
TO
RewriteRule \1 - [F]
^Redirect(?:Match)? 301 /(.+)
TO
RewriteRule \1 [R=301,L]
^Redirect(?:Match)? 410 /(.+)
TO
RewriteRule \1 - [G]
^Redirect(?:Match)? 403 /(.+)
TO
RewriteRule \1 - [F] should be used to convert the lines of redirects to rewrite rules via "find & replace" using a text editor that can use RegEx (regular expressions). Then the resulting text could replace the Redirect lines that are in the htaccess file. The purpose of using the text editor with RegEx is to save you the time and trouble of manually converting each line of Redirect to a RewriteRule. ^Redirect(?:Match)? 403 /(.+)to find, and
RewriteRule \1 - [F]to replace and the text editor could replace every instance of your 403 redirects.
replace \1 with $1 depending on your RegEx engine
^Redirect(?:Match)? 301 (\^)?/(.+)
TO
RewriteRule \1\2 [R=301,L]
^Redirect(?:Match)? 410 (\^)?/(.+)
TO
RewriteRule \1\2 - [G]
^Redirect(?:Match)? 403 (\^)?/(.+)
TO
RewriteRule \1\2 - [F]Note the difference between ^ meaning “the beginning of the line you’re editing” and \^ meaning “the literal ^ character”. ^Redirect(?:Match)? 301 (\^)?/(.+)
TO
RewriteRule \1\2 [R=301,L]
applied to ^Redirect(?:Match)? 410 (\^)?/(.+)
TO
RewriteRule \1\2 - [G]applied to I have approx 40 urls with 301 statements such as
Redirect 301 /watches/ice/ /department/watches/
Redirect 301 /collectables/lolita/ /department/gifts/
They all work ok, no bad url.
Redirect 301 /designer-watches/ice https://example.comPlease do not do this. You clearly have a 410 in place for other files; do the same for these. Make sure you have a nice 410 page. Depending on individual circumstances, you may be able to use the same physical page you serve for a 404, but you still need a separate ErrorDocument directive.
RewriteRule ^/accurist-new-logo - [G]One difference between mod_rewrite and mod_alias in an htaccess file (or in a <Directory> section of config) is that there is no leading slash. Ever. This will not produce a 500-class error; the rule simply won't execute. (Trivia: This applies even if there is a malformed URL with two consecutive slashes. For some reason, multiple directory slashes are only recognized in a RewriteCond. I don't know if the docs explain it anywhere; I learned it by experiment.)
Redirect 301 /gifts-and-collectables/$This will not work as intended. The $ is an anchor, so the rule has to use RedirectMatch.
Redirect 301 /designer-jewellery/fredbennett/mens-jewellery-collection/ /department/jewellery/fred-bennett/My find-and-replace rule assumes that your redirect target includes the full protocol-plus-domain. If it doesn't, you'll need to add it:
^Redirect(?:Match)? 301 (\^)?/(\S+) /(.*)
TO
RewriteRule \1\2 https://example.com/\3 [R=301,L]
by "this" lucy24 meansYears ago I was active on a forum where site modifications typically went like this: