adrianTNT Posted November 22, 2009 Share Posted November 22, 2009 Hello. I have a domain that I use for domain parking, let's say parking.com, in root of this site I have a folder "domains" and I will keep all content of my parked domains inside this folder: phisical directory structure is: parking.com/domains/somesite.com/ parking.com/domains/someothersite.com/ I am doing this by htaccess so that by accessing some-site.com it will show the content of parking.com/domains/some-site.com I have a trailing slash problem with my code: If I enter in browser somesite.com/sample/ it works ok but if I enter somesite.com/sample it redirects incorrectly in address bar, it goes to http://somesite.com/domains/somesite.com/sample/ but shows correct content though. Is there a way to maybe redirect somesite.com/sample to somesite.com/sample/ ? My htaccess, ady advices/fixes are welcome: RewriteCond %{HTTP_HOST} !parking.com RewriteCond %{HTTP_HOST} !208.109.209.xx RewriteCond $1 !^domains # with or without www redirect to a folder without www RewriteCond %{HTTP_HOST} ^(www.)?([^.]*)\.(.*)$ [NC] RewriteRule ^(.*)$ /domains/%2.%3/$1 [L,QSA] # redirect to index without any "if file exists" exception, otherwise root "/" exists and directory list will be printed ?! RewriteRule ^domains/([^/]*)/$ /domains/?domain=$1 # allow for existent files, redirect otherwise RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^domains/([^/]*)/(.*)$ /domains/?domain=$1&page=$2 [L,QSA] Link to comment https://forums.phpfreaks.com/topic/182559-adding-a-trailing-slash-well-kind-of/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.