Page 1 of 1

One Question about .htaccess ->

Posted: Sat Feb 11, 2012 8:06 am
by yasinipersian
Hello

—————
One Question ...
I need to convert this URL
for exampel:{like wordpress}

...../?p=26 ==> ...../user.php?username=26

I use this .htaccess but not work

Options +FollowSymlinks
RewriteEngine On
RewriteRule ?p=([a-zA-Z0-9_-]+)$ user.php?username=$1

please help me …

excuse me my language is persian
if my speaks not true
——————–

THANKS

Re: One Question about .htaccess ->

Posted: Wed Feb 15, 2012 8:58 am
by azycraze
pls post the full url

Re: One Question about .htaccess ->

Posted: Thu Feb 16, 2012 5:48 am
by yasinipersian
hello
=======================================
This url is in localhost ....
for example:
localhost/test/?p=26 ==>localhost/test/user.php?username=26
=======================================
thanks

Re: One Question about .htaccess ->

Posted: Thu Feb 16, 2012 10:08 am
by azycraze
Try this
----------------------------------------------------
RewriteEngine On
RewriteRule ^\?p\=([a-zA-Z0-9_-]+)$ user.php?username=$1
=======================================================

You have to use backslash to use ?,._& etcccc.........

Re: One Question about .htaccess ->

Posted: Sat Feb 18, 2012 4:21 am
by yasinipersian
One:thanks for your answer :)
Two:this answer dont work for (\?p ....) but when remove (\?) for ( \p ....) work true...

my problem exactly is ===>(?) and dont remove problem this question mark with backslash .... i dont know doing ...
I searched all of the web but not found this way for this problem