Question

I want to make a Friendly URL for my social network, i'm using phpDolphin script that's a sample profile link http://sample.com/index.php?a=profile&u=admin i want to make the profile URL to be like this http://sample.com/admin

my htaccess file

RewriteEngine on
RewriteCond %{request_filename} -f
RewriteRule ^(.*) $1 [L]
RewriteRule ^(([^/]*)+)(/([^/]{0,32})(/.+)?)?$  index.php?a=$1&q=$3    [L]
Was it helpful?

Solution

Replace your code with this:

Options +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/.]+)/?$ index.php?a=profile&u=$1 [L,QSA]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(([^/]*)+)(/([^/]{0,32})(/.+)?)?$ index.php?a=$1&q=$3 [L,QSA]
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top