Jump to content
Old threads will finally start getting archived ×

mod_rewrite to php script


cmgmyr

Recommended Posts

I want to do a "MySpace" url rewrite.

My .htaccess is:[code]RewriteEngine  on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)/$ /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 information

Thanks,
-Chris
Link to comment
https://forums.phpfreaks.com/topic/16216-mod_rewrite-to-php-script/
Share on other sites

  • 1 month later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.