Jump to content

mod rewrite


taith

Recommended Posts

hey everyone

 

i'm using the following mod rewrite, and it doesnt seem to be working 100%

 

RewriteEngine on
RewriteRule ^images/.*$ - [PT]
RewriteRule ^jscripts/.*$ - [PT]
RewriteRule ^(.*/.*)$ index.html?s=$1 [L]

 

it works as long as the url is "http://url/whatever/" but if you leave out the first / on the first bit after the server... it treats it like a folder/file, and skips that rule... anyone know how to fix it?

Link to comment
https://forums.phpfreaks.com/topic/148764-mod-rewrite/
Share on other sites

Uhm you have to tell each line whant you want to change the url to best is to start with the longest first. in the case of image jscript you havent told it the original location here a short example.

 

RewriteRule ^abonnement/(.*).html$ /abonnement.php?cat=$1 [L]
RewriteRule ^reviews/(.*).html$ /reviews.php?review=$1 [L] 
RewriteRule ^vakantie.php/ /index.php?cat=vakantie [L]

Link to comment
https://forums.phpfreaks.com/topic/148764-mod-rewrite/#findComment-781173
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.