I have a wordpress site with a page template and 1 variable call uid (user id) , and I wanna change it to friendly url.
from
http://localhost/forum/edit-profile/?uid=1
to
http://localhost/forum/edit-profile/1
or
http://localhost/forum/edit-profile/uid/1
P/S: wordpress already has a .htaccess file , i just wanna add some additional codes to this.
I tried these solutions, but they are not working:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /forumengine/
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /forumengine/index.php [L]
RewrieCond %{QUERY_STRING} !no-redir [NC]
RewrieCond %{QUERY_STRING} uid=([^&]+) [NC]
RewriteRule ^(.*/edit-profile)/$ $1/%1 [R=301,NC,L]
RewriteCond %{REQUEST_FILENAME} !-d # not a dir
RewriteCond %{REQUEST_FILENAME} !-f # not a file
RewriteRule ^(.*/edit-profile)/(d+)$ $1/?uid=$2&no-redir [NC,QSA,L]
</IfModule>
Add this to your
.htaccess
rulesThis would redirect
/forum/edit-profile/?uid=1
to/forum/edit-profile/1
and back.EDIT : (with wordpress rules they should go like)