Jump to content

Rewrite Help


steviez

Recommended Posts

Hi,

 

If someone goes to my site and navigates to: http://www.mysite.com/username it rewrites them to profile.php?user=username

 

I need it to also work with user id, for example: http://www.mysite.com/235 would rewrite to: profile.php?user_id=235

 

Here is my current code:

 

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/?$ /profile.php?user=$1 [L]

 

Thanks in advance :)

Link to comment
https://forums.phpfreaks.com/topic/91397-rewrite-help/
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.