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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.