0

I have an increase in soft 404 errors.

Using Apache in my .htaccess file I have:

Redirect 301 /test.html‎ /page/pop/test
Redirect 301 /about.html‎ /about 

I have also tried:

Redirect 301 http://www.example.co.za/test.html‎ http://www.example.co.za/services/test 

however whenever I go to:

http://www.example.co.za/test.html
http://www.example.co.za/about.html

it just redirects to the home page

I also have: RewriteRule ^.*$ index.php [NC,L] in .htaccess

1

Neither of your attempts to get the syntax for your "Redirect 301" rules is correct. The format should be:

Redirect 301 /relative-uri http://fully.qualified/url

So:

Redirect 301 /test.html‎ http://www.example.co.za/page/pop/test
Redirect 301 /about.html‎ http://www.example.co.za/about 

As nathangiesbrecht says, your rewrite rule may also be interfering.

  • Tried this, it didn't work. I need the rewrite rule as the web project is using a framework so every request goes through index.php. Should i put it at the bottom rather? – Stevie G Oct 31 '13 at 13:36
  • 1
    The redirect rules should go first so that they happen first. – Stephen Ostermiller Oct 31 '13 at 13:37
0

The rule RewriteRule ^.*$ index.php [NC,L] in .htaccess is redirecting all requests to your index.php page (home page). Remove that, and the rest of your redirects should work as expected.

  • Yes, all requests go index.php as the web project is using a framework, should I put it at the bottom rather – Stevie G Oct 31 '13 at 13:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.