TSlegaitis
TSlegaitis

Reputation: 1310

htaccess 301 redirects to wrong url

So I did a 301 redirect with htaccess but dont understand why the final link is wrong?

This is what I end up with http://example.com/about?/about-us/

Rather than a clean intended http://example.com/about

This is my htaccess code

Redirect 301 /about-us/ /about

To me this looks fine... What have I done wrong?

I need to redirect from http://www.example.com/about-us/

I've also tried

Redirect 301 /about-us/ http://example.com/about

Upvotes: 2

Views: 1483

Answers (1)

Florian Lemaitre
Florian Lemaitre

Reputation: 5748

You can try using apache mod_rewrite instead of using Redirect:

RewriteEngine on
RewriteBase /
RewriteRule ^about-us/?$ /about [L,R=301]

Upvotes: 1

Related Questions