![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Jan 2006
Posts: 1
Rep Power: 0
![]() |
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 |
|
|
|
|
|
#2 |
|
Professional Programmer
|
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] |
|
|
|
|
|
#3 |
|
Hobbyist Programmer
Join Date: Sep 2004
Posts: 206
Rep Power: 4
![]() |
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
__________________
_______________________________ BlazingWolf |
|
|
|
|
|
#4 |
|
Programmer
|
add a basic .htaccess to your web directory containing the following:
RewriteEngine On RewriteRule ^(.*)$ /imr/user?user=$1 [L,QSA] |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|