Jump to content

Mod_Rewrite Question


wemustdesign

Recommended Posts

Hi,

 

I am trying to create a mod rewrite to make my URL go from:

 

/?page=services&section=plastering

 

to

 

/services/plastering/

 

This is what I had come up with but didn't work, am I on the right lines or will this rewrite not be possible?

 

RewriteRule ^/services/([^/\.]+)/?$ index.php?services=$1&section=$2 [L]

 

 

Link to comment
https://forums.phpfreaks.com/topic/205305-mod_rewrite-question/
Share on other sites

Yes, that's about right, my guess is you need a forward slash before index.php.

 

RewriteRule ^/services/([^/\.]+)/?$ /index.php?services=$1&section=$2 [L]

 

Also, please note that this means all links on your site should be of the form /services/plastering/, don't expect it to magically switch your URLs.

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.