在一个url中隐藏php扩展和隐藏子目录在.htaccess中不起作用
1代码在folder1中不起作用,因为我使用2代码隐藏 子文件夹在一个url中隐藏php扩展和隐藏子目录在.htaccess中不起作用,php,regex,apache,.htaccess,mod-rewrite,Php,Regex,Apache,.htaccess,Mod Rewrite,1代码在folder1中不起作用,因为我使用2代码隐藏 子文件夹 my site url is looks like this mysite.com/folder1/file and i want this mysite.com/file hide folder1 and .php but it is not working while using 2code any solution 请尝试以下代码: Options +FollowSymlinks -MultiViews RewriteEn
my site url is looks like this mysite.com/folder1/file
and i want this mysite.com/file hide folder1 and .php but it is not working while using 2code any solution
请尝试以下代码:
Options +FollowSymlinks -MultiViews
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{DOCUMENT_ROOT}/$1.php -f
RewriteRule ^(.+?)/?$ /$1.php [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^((?!folder/).+)$ /folder/$1 [L,NC]
您请求的页面不可用发生了一般性错误2个站点之间的差异是什么?
Options +FollowSymlinks -MultiViews
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{DOCUMENT_ROOT}/$1.php -f
RewriteRule ^(.+?)/?$ /$1.php [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^((?!folder/).+)$ /folder/$1 [L,NC]