localhost中的htaccess rewriteRule

时间:2015-01-26 04:48:51

标签: .htaccess mod-rewrite rewrite

我的localhost的taha目录中有一个项目,客户端部分位于FrontEnd目录中,现在:

如何在localhost/taha/FrontEnd中将localhost重写为.htaccess

1 个答案:

答案 0 :(得分:0)

您可以在DOCUMENT_ROOT/.htaccess文件中使用此代码:

RewriteEngine On
RewriteBase /

# If the request is not for a valid directory
RewriteCond %{REQUEST_FILENAME} !-d
# If the request is not for a valid file
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule !^taha/FrontEnd/ taha/FrontEnd%{REQUEST_URI} [L,NC]