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] 
2
  • 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. Commented Jul 15, 2013 at 4:55
  • THANKS i am trying :) Commented Jul 15, 2013 at 5:01

1 Answer 1

1

You just have to use this code :

RewriteEngine on RewriteRule ^([0-9]+)$ /profile.php?id=$1 [L] 
Sign up to request clarification or add additional context in comments.

1 Comment

ty let me check this on server :)

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.