Hi, noob when it comes to .htaccess.
I need a mod_rewrite of a URL. URL example is as shown:
http://example.com/folder/script.php?location=UK&Name=Fred
I want it to transform to:
http://example.com/folder/UK/Fred
Hi, noob when it comes to .htaccess.
I need a mod_rewrite of a URL. URL example is as shown:
http://example.com/folder/script.php?location=UK&Name=Fred
I want it to transform to:
http://example.com/folder/UK/Fred
Try this rule:
RewriteRule ^([^/]+)/([^/]+)/([^/]+)$ $1/script.php?location=$2&Name=$3
This will rewrite requests to /<folder>/<location>/<Name>
internally to /<folder>/script.php?location=<location>&Name=<Name>
.
RewriteCond %{QUERY_STRING} location=([^&]+)&Name=(.+)
RewriteRule ^/folder/script.php$ http://website.com/folder/%1/%2? [R]