Forum Moderators: phranque

Message Too Old, No Replies

rewrite problem

         

sampford

3:25 pm on May 11, 2007 (gmt 0)

10+ Year Member



I have the following in my .htaccess file

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME}!-f
RewriteCond %{REQUEST_URI}!(.*)/$
RewriteRule ^(.*)$ [domain.com...] [L,R=301]

This corrected a problem that somehow made my domain name forward to .net, instead of the .com

can someone help me add a new rule to make all non-slashed directores forward to index.php

ie. www.domain.com/about/ - forward to www.domain.com/about/index.php

currently (and strangely) - these forward to www.domain.com

thanks in advance

jdMorgan

3:51 pm on May 11, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Your code should already do that. If I had to guess, I would say that your host has set
UseCanonicalName on
and that your ServerName is set to www.example.net instead of www.example.com.

If this is the case, ask them to turn off UseCanonicalName, and to set your ServerName to www.example.com, while setting example.net, www.example.net, and example.com as ServerAliases.

If this guess is correct, the suggested changes will clear up a lot of mysterious behaviour, and make your life a whole lot easier.

Jim