Avatar of santoor
santoor
Flag for Afghanistan asked on

Skip a directory with htaccess

RewriteCond %{HTTP_HOST} ^(www.)?example\.com$ [NC]
RewriteRule ^(.+)/$ http://%{HTTP_HOST}/$1 [R=301,L]

Open in new window


So i have this in my htaccess file to take care of the trailing slash problem . It redirects you every time you add a trailing slash on a url.

The issue here is the fact there is one directory and all its subdirectoies where it needs the trailing slash or it breaks. How do I add a exception for a directory like http://www.example.com/com/ and http:///www.example.com/com/sub/?XXXXX to this rule..

the page thats breaking because of the rewrite looks like this

 http:///www.example.com/com/sub/?view=XXXX&layout=XXXXX

thanks
Web DevelopmentPHPApache Web Server

Avatar of undefined
Last Comment
santoor

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
santoor

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Your help has saved me hundreds of hours of internet surfing.
fblack61