0

I am trying to replace link but ending with internal server error

www.domain.com/profile.php?id=1 

i want it to ->

www.domain.com/1

.htaccess

RewriteEngine on

RewriteCond %{HTTP_HOST} ^www\.domain\.com$
RewriteRule ^login\.php\/?(.*)$ "http\:\/\/domain\.com\/$1" [R=301,L]

RewriteRule ^([^/]*)$ /profile.php?id=$1 [L]
  • Line 4 can never work, because you can not match the part after ? with RewriteRule. For this, you can use RewriteCond [like in this Question](http://stackoverflow.com/questions/2252238/how-can-i-match-query-string-variables-with-mod-rewrite). – Lars Ebert Jul 15 '13 at 04:55
  • THANKS i am trying :) – New On here Jul 15 '13 at 05:01

1 Answers1

1

You just have to use this code :

RewriteEngine on
RewriteRule ^([0-9]+)$ /profile.php?id=$1 [L]
Lucas Willems
  • 6,673
  • 4
  • 28
  • 45