redirect 301 /services/ /service/onetime/
(Assuming that is just a typo on the target URL?)
The mod_alias Redirect
directive is prefix matching, and appends everything after the match onto the end of the target URL. So, this will also match the redirected URL /services/onetime/
and then append everything after the match (ie. onetime/
) onto the end of /services/onetime/
, etc. etc. until the browsers redirect limit is reached.
You would need to use the (mod_alias) RedirectMatch
directive instead, which uses regex. For example:
RedirectMatch 301 ^/services/$ /services/onetime/
This only matches /services/
and redirects to /services/onetime/
(including the trailing slashes).
Make sure you have cleared any intermediary caches before testing since any previous (erroneous) 301 redirects are likely to have been cached by the browser.
However, if you have existing mod_rewrite directives (ie. RewriteRule
) then you should consider using mod_rewrite instead for this redirect, in order to avoid potential conflicts. For example:
RewriteRule ^services/$ /services/onetime/ [R=301,L]
This will probably need to go before any other mod_rewrite directives. It can be easier to test with temporary (302) redirects since they won't be cached by the browser, unlike permanent (301) redirects. So, ensure your browser cache is cleared.