Reputation: 65
i'v been stuck with this <a href="profile.php?u=<?php echo $uiname ?>"/>
, i'm trying to hide the $_GET
variable but no success.
what i'm trying to achieve is something like www.mywebsitename.com/profile/name
or www.mywebsite.com/name
instead of
profile.php?u=name
is it possible to do so ?
Upvotes: 4
Views: 9550
Reputation: 10717
For Your URL: http://localhost/ifinal/profile/myname
You can use like with htaccess:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /ifinal/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^profile/(.*) profile.php?u=$1
</IfModule>
If your site not underfolder, use just RewriteBase /
And use HTML
<a href="profile/<?php echo $uiname; ?>">
<?php echo $uiname; ?>
</a>
Upvotes: 3