TecTao Posted June 28, 2012 Share Posted June 28, 2012 On a membership site, a user has a code consisting of two capital letters and and series of numbers, such as FL830. There is a php page, website.php that will query the DB and display user information. The page and user information can be access with a GET request www.examplesite.com/webpage.php?rep_id=FL830 What I want if for a viewer to only have to type in www.examplesite.com/FL830 I have written a mod_rewrite in the .htaccess file in the root of the site. The following code is RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*).com/([A-Z]+)-([0-9]+)$ (.*).com/webpage.php?rep_id=$1-$2 [L] The rule being that if someone types in Capitals and numbers after the examplesite.com that it will complete the GET request. This is not working. If I type in the URL www.examplesite.com/webpage.php?rep_id=FL830 the page comes up with the users information. If I type in www.examplesite.com/FL830 it errors with a 404 page not found. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.