vanity url for own site

189 views Asked by At

Hello i tried too much and i coudln't find a solution so i decided to ask here currently iam using wordpress website and my pages and posts link will be www.mydomain.com/postname and i want to make members user profile link like www.mydomain.com/user/profilename must redirect to profile.php?user=Username

Currently iam having this code in .htaccess:

IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*
<Limit GET POST>
order deny,allow
deny from all
allow from all
</Limit>

<Limit PUT DELETE>
order deny,allow
deny from all
</Limit>

AuthName sampcnc.com

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

So please help how to do this , Thanks in advance

1

There are 1 answers

1
Jon Lin On

i want to make members user profile link like www.mydomain.com/user/profilename must redirect to profile.php?user=Username

Before your wordpress rules # BEGIN WordPress, add these:

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

So when someone entes www.mydomain.com/user/profilename in their browser's URL address bar, they get served the content at /profile.php?user=profilename. You'll just have to make sure any links you generate look like the /user/profilename version.