0

I had to move a CMS to a subfolder. as a result, the URL saved in search engines are pointing to broken link.

what I did to solve the problem is coding a page with PHP as 404 page that gets the broken link, fix it, and then, redirects to the true page on the fly .. or, it'll just point to the index page.

But, unfortunately, I face hard time trying to make it the default 404 page in an Apache server. It just won't, I tried some .haccess tricks but they keep redirecting without sending the requested URL to (404.php) to be fixed ..

I tried to include the code in the 404.shtml, but it won't work ethier.

what all I want is to know the requested URL so that I can handle it ..

any idea?

ajreal
  • 46,720
  • 11
  • 89
  • 119
Mak
  • 1

1 Answers1

0

Try using mod_rewrite.

lolraccoon
  • 91
  • 1
  • 2
  • 7
  • I'm not expert in .haccess tricks, I just tryied different method in ErrorDocument 404, I then tried mod_rewrite .. but I think coded it wrong , because it keeps showing 500 error .. I want the broken link to be redirected to a subfolder, is it possible using mod_rewrite, example: http://www.mysite.com/article.php?method=xxx&id=xxx to http://www.mysite.com/cms/article.php?method=xxx&id=xxx – Mak Dec 04 '10 at 18:36
  • Yes. You would use a RewriteRule. – lolraccoon Dec 06 '10 at 02:05