...

View Full Version : htaccess - Rewrite root folder?



htcilt
06-13-2011, 11:44 AM
I've had a good look on Google but couldn't see any examples of my scenario... or none that I could understand lol.

Here's my situation. I have a htaccess rewrite that takes the url http://www.mydomain.com/advert and points to http://www.mydomain.com/adverts/juneadvert/index.php This works fine, however, I want all the source code paths (javascript, css etc) to use the /advert slug too. That way the true path is hidden from the user.

E.g. I dont want: http://www.mydomain.com/adverts/juneadvert/css/style.css

I do want: http://www.mydomain.com/advert/css/style.css

Is this possible?

htcilt
06-13-2011, 02:06 PM
Someone over at Stack Overflow solved this for me :)


Options -Indexes -MultiViews +FollowSymLinks
RewriteEngine On

RewriteRule ^advert/((css|js)/.*)$ /adverts/juneadvert/$1 [L,NC]



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum