views:

64

answers:

3

Hi there,

when my user logs in, I want the get variables that were sent rewrote onto the URL like so:

http://mysite.com/mygetvar1/mygetvar_value1/mygetvar2/mygetvar_value2/

or

mysite.com/mygetvar1=mygetvar_value1/mygetvar2=mygetvar_value2/

How can I do this? Please help! Thanks!

A: 

Codeigniter can offer you like that. Many other PHP frameworks offer that as well.

netrox
A: 

Try this.

RewriteRule /([^/]*)/([^/]*)/([^/]*)/([^/]*)/ /login.php?$1=$2&$3=$4 [R=301]
RewriteRule /([^/]*)=([^/]*)/([^/]*)=([^/]*)/ /login.php?$1=$2&$3=$4 [R=301]
jcubic
A: 

First you need the mod_rewrite module enable.

After, put this in your config file :

RewriteEngine on
RewriteRule ^ads/(rims|tires|combo)/([0-9]+)/(.+).html     /ad.php?noAds=$2 [L,QSA]

This is a example. Your url will look like : http://www.yourwebsite.com/ads/rims/331/title.html but you will call the url : http//www.yourwebsite.com/ad.php?noAds=331

For your regex , you should use a site like http://www.rubular.com

You can use the .htaccess file or put in directly in the httpd.conf file

racar