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. Link to comment https://forums.phpfreaks.com/topic/264944-help-with-mod_rewrite-and-page-re-write-to-php-quary-page/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.