.htaccess htaccess中的冲突规则阻止显示404页面
我已经有一个条件来检查不存在的页面,并相应地显示404页面。但是,当我在子目录“cms”中时,由于规则冲突,该规则不起作用。我怎样才能解决这个问题?我的代码如下所示:.htaccess htaccess中的冲突规则阻止显示404页面,.htaccess,web-development-server,.htaccess,Web Development Server,我已经有一个条件来检查不存在的页面,并相应地显示404页面。但是,当我在子目录“cms”中时,由于规则冲突,该规则不起作用。我怎样才能解决这个问题?我的代码如下所示: #This worked fine RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ /404.html [L,NC] #with this rule 404 wou
#This worked fine
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ /404.html [L,NC]
#with this rule 404 would not show
#e.g. mywebsite.com/cms/non_existent.php would not show 404 page
RewriteRule ^events/ cms/callers.php [L]
RewriteRule ^event/(.*)/ cms/callingparty.php?eventid=$1 [L]
RewriteRule ^cms/(.*)/(.*)/ cms/showpage.php?param1=$1¶m2=$2 [L]
RewriteRule ^cms/(.*)/ cms/showpage.php?param1=$1 [L]
当您键入“域/事件/?时会发生什么情况?它将显示404页,但如果我键入“域/cms/”则只会显示一个空白页。对不起,我不在家,无法提前回复您。当您键入“域/事件/?时会显示404页,但如果我键入“域/cms/”则只会显示一个空白页。对不起,我不在家,无法提前回复您。