0

I used .htaccess to change my url from

http://example.com/profile.php?user_id=115451

to

http://example.com/profile/115451

This is my .htaccess it work for me.

RewriteEngine On
RewriteRule ^profile/([^/]+)/?$ profile.php?user_id=$1 [L,QSA]

But in my profile.php have a tag like this

<a href='./'>Home</a>

When I click this link it should goto http://example.com/ but it goto http://example.com/profile/

Same problem with img tag, image on http://example.com/profile/115451 can not load,

But on http://example.com/profile.php?user_id=115451 it's no problem.

1 Answers1

0

What you are looking for is exactly that:

<a href='/'>Home</a>

Nothing to change in .htaccess

Croises
  • 18,570
  • 4
  • 30
  • 47