简体   繁体   中英

Modify the URL through an .htaccess file

I have a URL which looks like

localhost/myapp/index.php?mod=user&page=createuser

I want the URL to look like

localhost/user/createuser

How do I do this with a htaccess file?

RewriteEngine On
RewriteRule ^([^/]*)/([^/]*)$ /myapp/index.php?mod=$1&page=$2 [L]

Try this

RewriteEngine on
RewriteRule ^myapp/(.+)/(.*) myapp/index.php?mod=$1&page=$2 [L]

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