Page 1 of 1

how do i create nice urls for a query string?

New postPosted: 10 Jan 2008 15:50
by anrpalmer
hi, im new to mod_rewrite and need a bit of help.

I'd like to create some user friendly URLs that point to a php file. So something like:

http://www.domain.com/people/joe_bloggs

will pull up:

http://www.domain.com/people/view.php?name=joe_bloggs

currently my .htaccess file looks like this. but its not working. all help appreciated...


RewriteEngine on
RewriteBase /
RewriteRule ^/people/([A-Za-z0-9])?$ /people/view.php?name=$1 [L,NC]


This isn't working. What should the rule be?

New postPosted: 17 Jan 2008 03:15
by rewritecond
Code: Select all
domain.com/people/joe_bloggs ->
domain.com/people/view.php?name=joe_bloggs


Code: Select all
RewriteEngine On
RewriteBase /
RewriteRule ^/people/([A-Za-z0-9]+)?$ /people/view.php?name=$1 [L,NC]