Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

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

share|improve this question

2 Answers 2

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.

share|improve this answer
    
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

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.

share|improve this answer
    
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

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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