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