.htaccess rewrite outputs undesired content. I think??

Posted by Mark on Stack Overflow See other posts from Stack Overflow or by Mark
Published on 2010-03-18T00:02:14Z Indexed on 2010/03/18 0:11 UTC
Read the original article Hit count: 760

Filed under:
|

I am trying to rewrite a URL using .htaccess. I am running on Apache version 2.2.15.

Contents of .htaccess:

RewriteEngine on
RewriteRule cars/(.*) cars/member_page.php?user=$1
RewriteRule cars/(.*)/ cars/member_page.php?user=$1

Contents of member_page.php:

<?php
echo $_GET[user];
?>

URL entered into browser:

http://www.mydomain.com/cars/user1

The browser outputs the string "member_page.php" instead of "user1"

How do I make it output the contents of (.*) from the original URL.

© Stack Overflow or respective owner

Related posts about .htaccess

Related posts about mod-rewrite