[英]mod_rewrite rules for a site hosted in a directory
我有一个要在目录中而不是在Web服务器根目录中构建的网站。
I would like http://localhost/mysite/index.php?view=home
to rewrite to http://localhost/mysite/home
我无法正常工作
在.htaccess中尝试
RewriteEngine On
RewriteBase /mysite/
RewriteRule ^([^/]*)$ index.php?view=$1 [L]
我知道了!
RewriteEngine On
RewriteRule ^([A-Za-z0-9-]+)/?$ index.php?view=$1 [L]
非常感谢http://www.cheatography.com/davechild/cheat-sheets/mod-rewrite/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.