Jump to content

rewrite rule


wemustdesign

Recommended Posts

I have wrote a rewrite rule to get my url as short as possible. The first section works but the second doesn't. Any suggestions appreciated:

 

--------------------------------------------------------------------------------------

url:

index.php?uk=newcastle

 

outputs fine as:

/newcastle/

 

using rewrite rule:

RewriteRule ^([^/\.]+)/?$ index.php?uk=$1 [L]

--------------------------------------------------------------------------------------

 

I cannot get the second rule to work. I don't know if I have an error inb my code or if it is not possible to shrink the rule so much.

 

The url:

index.php?uk=newcastle&type=small

 

this is what I want to work:

/newcastle/small

 

this is the rule but doesn't work

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

--------------------------------------------------------------------------------------

Link to comment
https://forums.phpfreaks.com/topic/194058-rewrite-rule/
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.