Apache 将folder/page.php重定向到folder/page.htaccess
我正在寻找有关.htaccess文件的帮助。Apache 将folder/page.php重定向到folder/page.htaccess,apache,.htaccess,web,Apache,.htaccess,Web,我正在寻找有关.htaccess文件的帮助。 我想为domain.net/test.php做domain.net/test,也为domain.net/folder/index.php做domain.net/folder。可能吗?您可以在站点根目录中使用此代码。htccess: DirectorySlash On DirectoryIndex index.php RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %
我想为
domain.net/test.php
做domain.net/test
,也为domain.net/folder/index.php做domain.net/folder
。可能吗?您可以在站点根目录中使用此代码。htccess:
DirectorySlash On
DirectoryIndex index.php
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.+?)/?$ $1.php [L]