Apache 使用双斜杠设置404错误。htaccess
如何在.htaccess中使用URL中的双斜杠设置404错误?问题是我的cur.htaccess不是空的Apache 使用双斜杠设置404错误。htaccess,apache,.htaccess,mod-rewrite,Apache,.htaccess,Mod Rewrite,如何在.htaccess中使用URL中的双斜杠设置404错误?问题是我的cur.htaccess不是空的 AddType application/x-httpd-php .php .html ErrorDocument 404 /404.php <IfModule mod_rewrite.c> Options +FollowSymLinks RewriteEngine On RewriteBase / # redirect from index.
AddType application/x-httpd-php .php .html
ErrorDocument 404 /404.php
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
# redirect from index.(php|asp|aspx|html|htm), main.(php|asp|aspx|html|htm), home.(php|asp|aspx|html|htm)
RewriteRule ^(.*)index\.(php|asp|aspx|html|htm)$ $1 [R=301,L]
RewriteRule ^(.*)main\.(php|asp|aspx|html|htm)$ $1 [R=301,L]
RewriteRule ^(.*)home\.(php|asp|aspx|html|htm)$ $1 [R=301,L]
RewriteRule ^(.*)default\.(php|asp|aspx|html|htm)$ $1 [R=301,L]
RewriteCond %{HTTP_HOST} ^(www|dev)\.site\.ru$ [NC]
RewriteRule ^(.*?)((?:index|default|home)\.(?:php|html?))?$ http://site.ru/$1 [R=301,L,NC]
</IfModule>
AddType应用程序/x-httpd-php.php.html
ErrorDocument 404/404.php
选项+FollowSymLinks
重新启动发动机
重写基/
#从索引重定向。(php | asp | aspx | html | htm),main.(php | asp | aspx | html | htm),home.(php | asp | aspx | html | htm)
重写规则^(.*)索引\(php | asp | aspx | html | htm)$$1[R=301,L]
重写规则^(*)main\(php | asp | aspx | html | htm)$$1[R=301,L]
重写规则^(.*)主页\(php | asp | aspx | html | htm)$$1[R=301,L]
重写规则^(.*)默认\(php | asp | aspx | html | htm)$$1[R=301,L]
重写cond%{HTTP|u HOST}^(www|dev)\.site\.ru$[NC]
重写规则^(.*)(?:index | default | home)\.(?:php | html?))$http://site.ru/$1[R=301,L,NC]
非常感谢。您所说的.htaccess中的
404错误是什么意思,URL中带有双斜杠?
?例如,我有以下URL:http://site.ru/abc.php, http://site.ru/123/dac.php
。如果我把http://site.ru////abc.php, http://site.ru//abc.php, http://site.ru///123////dac.php, http://site.ru//123//dac.php
我需要生成404错误。清楚了吗?