Click to See Complete Forum and Search --> : .htaccess and re-direct pages


The_Magus
04-10-2007, 12:13 PM
Hello guys and gals:

I had a post some time ago about .htacess files which ended up with quite a few replies and although this one is on the same subject I think it is best to start over again.

I have checked with the search for all the re-direct posts and still haven't found the solution to my problem nor advice on my new problem which are related - I think!!! Or I might say that I didn't recognize the solution even if I saw it.

I was originally looking for details to re-direct incoming requests for the index.html page to the new index.shtml page plus also to re-direct all referrals from search engines that were looking for htm or html to the new shtml pages.

I thought I had achieved that aim until I started messing with a new problem to day when I discovered that a request for www.xxxxx.com/index.html resulted in file not found page however a request for www.xxxx.com/index.htm produced the new index.shtml file.

My current .htaccess file reads as follows:

Redirect /index.html/http://www.xxxxx.com/index.shtml

RewriteEngine on
RewriteBase /
RewriteRule ^(.*)\.htm$ $1 [C,E=WasHTML:yes]
RewriteCond %{REQUEST_FILENAME}.shtml -f
RewriteRule ^(.*)$ $1.shtml [S=1]
RewriteCond %{ENV:WasHTML} ^yes$
RewriteRule ^(.*)$ $1.htm

It seems to me that the first line should produce the results but it doesn't.

I now want to add another re-direct in that I am changing my forum program from www.xxxxx.com/Forum/index.php or even www.xxxxxx.com/Forum (which also works) to http://www.xxxxxx.com/cgi-bin/yabb2/YaBB.pl but because I have advertised the first one I would like to add a re-direct instruction to send any incoming request for the old page to the new one.

Assistance will, as usual, be appreciated.

Thanks

Jack
The Magus

ray326
04-10-2007, 02:16 PM
I think the one that's working is actually because of the rewrite rule. Add some for .html$ and see what happens. (Just a guess. I'm totally ignorant of rewrite rules.)