Jack Trowbridge
Jack Trowbridge

Reputation: 3251

Mod Rewrite Sub Folder Structure to GET Variable

How would I write a url such as the following

www.linku.biz/profile/jacktrow

to

www.linku.biz/profile/?us=jacktrow

Being 'jacktrow' can be just letters (a-Z)

What would be the complete code I can place in a .htaccess in the directly of profile?

Much appreciated, mod rewrites and .htaccess are just such a pain!

Upvotes: 1

Views: 273

Answers (1)

Justin Iurman
Justin Iurman

Reputation: 19016

First, make sure mod_rewrite is enabled.

Then, put this code in your htaccess (in root folder)

RewriteEngine on
RewriteRule ^profile/([a-z]+)$ /profile/index.php?us=$1 [L]

Upvotes: 2

Related Questions