Jump to content

Mod rewrite issue


mrtricky

Recommended Posts

Hi, i have an issue with some htaccess mod rewrite code, what i need the script to do is redirect http://www.domain.com/username to http://www.domain.com/profile.php?user=username which i got working but i need a exception if the page is for example http://www.domain.com/signup or http://www.domain.com/help

 

Currently i have this

 

ErrorDocument 404 http://domain.com/

RewriteCond %{HTTP_HOST} !^domain\.com

RewriteRule ^(.*)$ http://domain.com/ [R=302]

RewriteEngine on

RewriteCond %{REQUEST_URI} !help

RewriteRule ^([^/\.]+)/?$ profile.php?id=$1 [L]

 

 

Which kind of works but it goes to a sub folder which isn't what i want really

 

can anyone help???

 

Link to comment
https://forums.phpfreaks.com/topic/165844-mod-rewrite-issue/
Share on other sites

Haven't been able to find any solutions online yet but have kind of fixed the problem myself not sure if its the correct way to do it but it seems to work fine.

 

ErrorDocument 404 http://domain.com/

RewriteCond %{HTTP_HOST} !^domain\.com

RewriteRule ^(.*)$ http://domain.com/ [R=302]

RewriteEngine on

RewriteRule ^(help+)/?$ help.php [L] 

RewriteRule ^([^/\.]+)/?$ profile.php?id=$1 [L]

Link to comment
https://forums.phpfreaks.com/topic/165844-mod-rewrite-issue/#findComment-875356
Share on other sites

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.