Jump to content

Mod-rewrite Regular Expression Query


ProblemHelpPlease
 Share

Recommended Posts

I am trying to use mod-rewrite (not used it before) to change address fromhttp://www.domain.com/file.php?variable1=u...ble2=atozstringtohttp://www.domain.com/folder/urlencodedstringatozstring or http://www.domain.com/folder/urlencodedstring (if possible)I have having difficulty with getting the correct regular expression as variable 1 is a mixed up jumble of characters due to it being urlencoded and is never in the same format ( the only thing thats the same is it only contains urlencoded characters ). All the examples always have something like id=123 or name=bobCan anyone offer a solution.

Link to comment
Share on other sites

I am currently using the code below, but am now having problems with the url encoded characters like %26 not working in my script as they are being read as chracters rather than being passed encoded, any ideas?

RewriteEngine OnRewriteRule ^(.+)/([a-z]+)/?$ file.php?variable1=$1&variable2=$2

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...