Jaffer
Jaffer

Reputation: 2968

confused with Mod rewrite RewriteRule

everything at my website is served from a master index.php at Document root

so normally all the functions looks like ./index.php?storage=seven

i wanted to make it looks better, so tried to use Mod_Rewrite as shown below

RewriteEngine On
RewriteRule ^/storage /index.php?storage=seven [L]

Now i am able to access the function using ./storage

but when somebody types ./storage/ (an extra '/' at end) or ./storage/some/junk the Link still works but the path to images/css/script in my page brakes(the paths to these is broken), which means, i just need it to be working for ./storage and everything else should give 404 error (./storage/ and ./storage//... to give 40)

Please help me out here, i am very new to Mod_reWrite

Thanks

Upvotes: 0

Views: 42

Answers (1)

Jaffer
Jaffer

Reputation: 2968

Small change in rule ... and it started working

    RewriteRule ^storage$ index.php?storage=seven [L]

By the way seven here is hard-coded from the Rule itself, please don't get confused with that

Thanks

Upvotes: 1

Related Questions