Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   PHP (http://www.programmingforums.org/forum29.html)
-   -   rewrite help (http://www.programmingforums.org/showthread.php?t=8007)

Arachnd Jan 17th, 2006 7:36 PM

rewrite help
 
is it possible to create a rewrite rule so that if
http://www.host.com/imr/user?=user
can actually be http://www.host.com/user ?

Really need help understanding these rules

Thanks,
Arachn1d

Lich Jan 18th, 2006 12:13 AM

try
[PHP]
if($_GET['user'])
{
header("Location: http://www.host.com/user");
}
[/PHP]

or if you want user in the url to be the user variable, you can use

[PHP]
if($_GET['user'])
{
header("Location: http://www.host.com/$_GET['user']");
}
[/PHP]

BlazingWolf Jan 18th, 2006 12:34 PM

You can also do it using Apache's mod_rewrite although I can't give you exact code because the on time I tried to understand it I didn't get it. :(

You might try

http://www.sitepoint.com/article/guide-url-rewriting
http://www.phpfreaks.com/tutorials/23/0.php

niteice Jan 19th, 2006 2:26 PM

add a basic .htaccess to your web directory containing the following:

:

RewriteEngine On
RewriteRule ^(.*)$ /imr/user?user=$1 [L,QSA]



All times are GMT -5. The time now is 4:35 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC