Harry
Harry

Reputation: 3391

Mod_Rewrite for only one folder

I want top be able to type http://website.com/new which will rewrite to http://website.com/index.php?view=new, but I only want the new directory to be "re-written".

I've tried this, but it doesn't seem to work...

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^new/ /index.php?view=new [L]
</IfModule>

Thanks!

Upvotes: 0

Views: 535

Answers (1)

Felipe Alameda A
Felipe Alameda A

Reputation: 11799

It should be like this:

Options +FollowSymlinks -MultiViews
RewriteEngine On
RewriteBase /
RewriteRule ^new/?$    /index.php?view=new [L,NC]

Upvotes: 1

Related Questions