scm22ri Posted December 12, 2012 Share Posted December 12, 2012 Hi Everyone, I've figured out how to re write a url correctly to my website. The problem is no content is showing on the page. I want to take the below URL http://whatsmyowncar...te=rhode island and turn it into this one (I think I've accomplish that but on the below URL, the page is showing no data). I figred my .htacess was a bit off but I'm not sure how. What am I doing wrong here? http://whatsmyowncar...om/rhode-island RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^([^/]*)$ /state.php?s=&u=$1 [L,NC] Quote Link to comment https://forums.phpfreaks.com/topic/271924-mod-rewrite-question-htaccess/ Share on other sites More sharing options...
mrMarcus Posted December 12, 2012 Share Posted December 12, 2012 Post the query for that page. Also, show how you're dealing with the url parameters 's' and 'u'. I'm guessing that your query is something like the following: $state = $_GET['state']; // rhode island $sql = "SELECT * FROM `table` WHERE `state` = '". $state ."'"; But now, because of the rewrite, the state is hyphenated and the query is failing. Quote Link to comment https://forums.phpfreaks.com/topic/271924-mod-rewrite-question-htaccess/#findComment-1398993 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.