Forum Moderators: phranque
I am not sure this is actually a PHP question but I would like to know how to redirect all non-existing pages or page requests to my new index.php file.
I strongly suggest you reconsider your basic approach and retain your static URLs unless your search engines rankings are of no consequence to you.
More information can be found by searching for, and reading, the many "search engine friendly URL [google.com]" threads here.
Jim
The procedure is:
So, for "welcome.htm" you would use:
RewriteRule welcome.html /index.php?id=10 [L]
#
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\?id=10\ HTTP/
RewriteRule ^index\.php$ http://www.example.com/welcome.html [R=301,L]
You will do better in the search engines if you use meaningful URLs, instead of publishing URLs with page numbers in them.
At any rate, I'd suggest some more research into "search engine friendly URLs [google.com]" and all the issues that surround their use. After you've decided what to do, then it will be time to implemetations.
Jim
We're almost done building our new website. In doing this all the pages are going from .jsp to html. So any listings that we had will come up 404 unless we do server side redirects from these old pages to the new ones.
My question is should we bother doing redirects for pages that used to be ranking well in the search engines at all? I mean Google and MSN are pretty fast in crawling, and alot of our listings are the root domain, not all of them are specific pages.
Is it better/worse to just let them go and wait for the site to be re-crawled?