cmgmyr Posted August 1, 2006 Share Posted August 1, 2006 I want to do a "MySpace" url rewrite.My .htaccess is:[code]RewriteEngine onRewriteCond %{REQUEST_FILENAME} !-dRewriteRule ^([^/]+)/$ /profile.php?moduser=$1 [L][/code]And the beginning of my profile.php is: [code]global $moduser;if(isset($moduser)){ $query = "SELECT userid FROM users WHERE mod='$moduser'"; $result = mysql_query($query) or die('Query failed: ' . mysql_error()); $userid = mysql_result($result, 0, 'userid'); }[/code]when I go to mysite.com/username it doesn't do anything. It just hangs up, no error message or anything.Let me know if you need any more informationThanks,-Chris Quote Link to comment https://forums.phpfreaks.com/topic/16216-mod_rewrite-to-php-script/ Share on other sites More sharing options...
hostfreak Posted August 1, 2006 Share Posted August 1, 2006 When I go there I get:[quote]404 Error -- File Not FoundThe page you are looking for (http://mysite.com/username) is not here.[/quote]Maybe this will help you: http://lotsofphp.com/tutorials/rewritten-urls-unlimited-parameters.html Quote Link to comment https://forums.phpfreaks.com/topic/16216-mod_rewrite-to-php-script/#findComment-67089 Share on other sites More sharing options...
cmgmyr Posted August 1, 2006 Author Share Posted August 1, 2006 Right...That was just an example.The actual link is: http://www.syracusebands.net/new/cmgmyrShould go to: http://syracusebands.net/new/profile.php?userid=169-Chris Quote Link to comment https://forums.phpfreaks.com/topic/16216-mod_rewrite-to-php-script/#findComment-67092 Share on other sites More sharing options...
cmgmyr Posted August 1, 2006 Author Share Posted August 1, 2006 **SOLVED**What I did was change that bottom line to: RewriteRule ^([^/\.]+)/?$ profile.php?moduser=$1 [L]Thank you,-Chris Quote Link to comment https://forums.phpfreaks.com/topic/16216-mod_rewrite-to-php-script/#findComment-67166 Share on other sites More sharing options...
vivek Posted September 21, 2006 Share Posted September 21, 2006 [b]EDITED BY WILDTEEN88: Please do not hijack other peoples threads. Please create your own thread[/b] Quote Link to comment https://forums.phpfreaks.com/topic/16216-mod_rewrite-to-php-script/#findComment-95881 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.