Jump to content

Recommended Posts

Hi there,

 

I'm having a little trouble working with a few different variables in my htaccess rewriterules.

 

What I have basically is a file called font.php, and inside it I have two different functions.

The first rule makes it so it says /fonts/font1/regular

all good.

However, within each font, there are options to see 'about' it. So instead of $weight; its $about...

 

I know the problem is that of they have the same pattern, is there any way of solving this? Or would it be best to change the php code so that I just work with one variable (weight), and then determine the data etc inside of the php file?

 

RewriteRule ^fonts/([a-zA-Z0-9^-]+)/([a-zA-Z0-9^-]+)$ /font.php?font=$1&weight=$2 [R=302]

RewriteRule ^fonts/([a-zA-Z0-9^-]+)/([a-zA-Z0-9^-]+)$ /font.php?font=$1&about=$2 [R=302]

 

Sorry if I'm not making too much sense!

Thanks in advance

 

Edd

Link to comment
https://forums.phpfreaks.com/topic/223273-multiple-variables-in-htaccess/
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.