Link to home
Start Free TrialLog in
Avatar of phillystyle123
phillystyle123Flag for United States of America

asked on

rewrite same url using slash AND no slash

Hi,

My client wants to be certain that if a site visitor types in a url with OR w/o a trailing slash i.e.

mysite.com/artists/warhol
OR
mysite.com/artists/warhol/

the same page will load.

currently my htaccess file has these rules-i can use one or the other, but not both -I NEED FOR BOTH TO WORK

RewriteRule ^/artists/(.+)$ /artists/artist.cfm?permalink=$1 [QSA]
RewriteRule ^/artists/(.+?)/ /artists/artist.cfm?permalink=$1 [QSA]
ASKER CERTIFIED SOLUTION
Avatar of sjklein42
sjklein42
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of phillystyle123

ASKER

perfect  - thanks!
I posted a continuation of this question here:

https://www.experts-exchange.com/questions/26823130/htaccess-rewrite-rule-optional-trailing-slash.html

because I'm having trouble getting the next url in my sequence to pull content from my database