wierd slash problem...

Using a single web hosting account to host multiple sites

wierd slash problem...

Postby Guest » Thu Sep 23, 2004 7:23 am

i am using some rules to redirect different domains to subdirs like this:

RewriteCond %{HTTP_HOST} otherdomain.com$ [NC]
RewriteCond %{REQUEST_URI} !^/otherdomain.com/.*$
RewriteRule ^(.*)$ /otherdomain.com/$1

the structure of the files is like this:

root (main site)
root/otherdomain.com/ (other site)
root/otherdomain.com/folder1 (folder inside other site)

it works fine if I type this into a browser:

http://otherdomain.com/folder1/

because the browser shows me

http://otherdomain.com/folder1/

but if i type this:

http://otherdomain.com/folder1

without the ending slash, i get this in my browser:

http://otherdomain.com/otherdomain.com/folder1/

any ideas what i can do to stop this from happening?
Guest
 

Postby Caterham » Fri Dec 10, 2004 3:12 pm

add
Code: Select all
RewriteRule !\..{3,4}$ - [C]
RewriteCond %{REQUEST_URI} !^.*/$
RewriteRule ^(.+)$ $1/ [R=301,L]
above all rules. Adds the slash if missing and a file with extension insn't requested.

Bob
Caterham
 
Posts: 690
Joined: Fri Dec 10, 2004 1:30 pm


Return to Domain Handling

Who is online

Users browsing this forum: No registered users and 97 guests

cron