0

当我在我的 url 路径之外键入任何内容时,例如:http://example.com/doctorlist/ngffghf5235235,我希望它被重定向到我的主页,即http://example.com 。我该怎么做 。我有我的 .htacess 如下

RewriteEngine on
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !/(css|images|js)/
RewriteRule ^home/(.*)$ index.php [QSA]
RewriteRule ^doctorlist/(.*)$ innerpage.php [QSA]
RewriteRule ^appointment-list/(.*)$ detailspage.php?doc_id=$1 [QSA]
RewriteRule ^register-plus-appointment-form/(.*)$      register_plus_appointment_form.php?doc_id=$1&time_id=$2&date=$3&time=$4 [L,QSA]
RewriteRule ^appointment-form/(.*)$ appoint_form.php [L,QSA]
RewriteRule ^appointment-confirm-form/(.*)$ appointment_form.php [L,QSA]
4

2 回答 2

1

将每个请求重定向到某个页面,例如 index.php

RewriteRule (.*) /index.php [L]

希望这可以帮助

于 2013-08-23T13:33:49.217 回答
0

根据您的标签,我假设您的 Zend Framework 应用程序需要它。所以这将完成这项工作:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]

请参阅:http: //framework.zend.com/manual/1.12/en/zend.application.quick-start.html

于 2013-08-23T14:38:25.743 回答