简体   繁体   中英

How to rewrite page name with with in htaccess

htaccess with php, I need to rewrite the below url

 freelancers.php?new=user

as

 register.php?new=freelancer

can any one help me out on this.

You can use this code in your DOCUMENT_ROOT/.htaccess file:

RewriteEngine On
RewriteBase /

RewriteCond %{THE_REQUEST} /register.php\?new=freelancer\s [NC]
RewriteRule ^ freelancers.php?new=user [R=302,L,NE]

RewriteCond %{QUERY_STRING} ^new=user$ [NC]
RewriteRule ^freelancers\.php$ register.php?new=freelancer [L,NC]

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM