本地主机中的 htaccess 重写规则

htaccess rewriteRule in localhost

我在本地主机的 taha 目录中有一个项目,客户端部分在 FrontEnd 目录中,现在:

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

您可以在 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]