New On here
New On here

Reputation: 1

Replacing link with .htaccess

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]

Upvotes: 0

Views: 33

Answers (1)

Lucas Willems
Lucas Willems

Reputation: 7073

You just have to use this code :

RewriteEngine on
RewriteRule ^([0-9]+)$ /profile.php?id=$1 [L]

Upvotes: 1

Related Questions