PDA

View Full Version : Directory listing removes www?


keithmcknight
7-16-05, 07:38 PM
I'm getting a rather unusual problem. Whenever I try to access a directory, it redirects to the corresponding directory without the www. and with the extra folder information. I have two domain names pointing to the same package and I have it organized so that in htdocs there are separate directories for each one and my .htaccess file points one domain to one directory and the other domain to the other one.

If you go to http://www.dootdootbeep.org/photos you'll be redirected to http://dootdootbeep.org/dootdootbeepdot/photos. Basically I want it not to do that.

I don't think it's my .htaccess file, because I had the missing www. problem even without it. Help?

fluKe
7-16-05, 09:28 PM
I'm 99.9% sure it will be your .htaccess file.

If you post the contents here for us to have a look at (minus any sensitive info) someone will probably be able to spot the problem :)

keithmcknight
7-17-05, 12:13 AM
RewriteEngine On
Options +FollowSymlinks
RewriteBase /

RewriteCond %{HTTP_HOST} www.dootdootbeep.org
RewriteCond %{REQUEST_URI} !dootdootbeepdot/
RewriteRule ^(.*)$ dootdootbeepdot/$1 [L]

RewriteCond %{HTTP_HOST} dootdootbeep.org
RewriteCond %{REQUEST_URI} !dootdootbeepdot/
RewriteRule ^(.*)$ dootdootbeepdot/$1 [L]

RewriteCond %{HTTP_HOST} brokenimage.checkeredshirt.net
RewriteCond %{REQUEST_URI} !mike/
RewriteRule ^(.*)$ mike/$1 [L]

RewriteCond %{HTTP_HOST} marmaduke.checkeredshirt.net
RewriteCond %{REQUEST_URI} !marmaduke/
RewriteRule ^(.*)$ marmaduke/$1 [L]

RewriteCond %{HTTP_HOST} www.checkeredshirt.net
RewriteCond %{REQUEST_URI} !checkeredshirt/
RewriteRule ^(.*)$ checkeredshirt/$1 [L]

RewriteCond %{HTTP_HOST} checkeredshirt.net
RewriteCond %{REQUEST_URI} !checkeredshirt/
RewriteRule ^(.*)$ checkeredshirt/$1 [L]

<files .htaccess>
Order allow,deny
Deny from all
</files>

RTH10260
7-17-05, 01:49 AM
If you go to http://www.dootdootbeep.org/photos you'll be redirected to http://dootdootbeep.org/dootdootbeepdot/photos. That's the side effect you get cause of the missing trailing slash !

Apply this: http://tips-scripts.com/?tip=slash#tip