Jump to content

redirect length of string


bigheadedd

Recommended Posts

Hi,

 

Wondering if this is possible at all.

 

I'm using htaccess to rewrite my pages, and i'm using the following line:

RewriteRule ^([a-zA-Z0-9^-]+)$ page.php?page=$1

to rewrite it into clean links. page.php then calls the data appropriately.

I am wondering though if its possible, that if the variable is 3 characters long it redirects to another page.

 

RewriteRule ^([a-zA-Z0-9^-]+{3})$ small.php?char=$1

Something similar the above? Is that possible? I just stuck the {3} for illustration purposes.

For example if my address was www.example.com/abc, it would redirect to small.php?char=abc and if it was any longer it would redirect to the page.php address.

 

Thanks in advance,

E

Link to comment
https://forums.phpfreaks.com/topic/266340-redirect-length-of-string/
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.