0

I am trying to setup a permanent 301 redirect via htaccess with the following rule Redirect 301 / https://uniziktne.afrihub.com

but the domain keeps redirecting to a 404 subdirectory https://uniziktne.afrihub.com/unizik_tne from the root afrihub.com/unizik_tne

Any pointers on where my redirect rule is wrong or a more efficient way of solving this would be appreciated

Tried using the redirect rule as described in the problem but the old domain keeps redirecting to 404 subdirectory of the targeted new domain.

  • That is the _expected_ behavior with `Redirect`, see explanation in the documentation: _"Then any request beginning with URL-path will return a redirect request to the client at the location of the target URL. Additional path information beyond the matched URL-path will be appended to the target URL."_ – CBroe Apr 03 '23 at 08:59
  • What URL(s) are you wanting to redirect? And to what? The rule you've posted is missing a trailing slash on the target URL so it won't redirect as you have stated... please confirm whether this is your actual rule, or a typo in your question. "keeps redirecting to a 404 subdirectory" - all URLs? Or just when you request a URL that is otherwise a 404 on the subdomain? – MrWhite Apr 03 '23 at 09:19

1 Answers1

0

So a fix was this line I used

Redirect /unizik_tne https://uniziktne.afrihub.com

Also made not about cookies/site data, when i tested it out initially the problem persisted but i tried on another computer/browser and it redirected correctly

  • This is a bad code smell - it looks like you are trying to fix a redirect with another redirect?! Rather than resolving why the undesirable redirect occurred in the first place and preventing that. – MrWhite Apr 03 '23 at 09:56