Gami
Gami

Reputation: 54

RewriteRule for profile system

I want to redirect website.com/member/gami To website.com/member.php?name=gami

I have tried:

RewriteRule ^(.*)/member$ member.php?name=$1 [NC, QSA]

Upvotes: 2

Views: 42

Answers (1)

RavinderSingh13
RavinderSingh13

Reputation: 133428

With your shown rules, please try following htaccess rules. Please make sure to clear your browser cache before testing your URLs.

RewriteEngine ON
##Internal rewrite rules for non-existing uris to php files internally.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{DOCUMENT_ROOT}/$1.php -f
RewriteRule ^([^/]*)/(.*)/?$ $1.php?name=$2 [QSA,L]

Upvotes: 2

Related Questions