我想举例www.mydomain.com/about.php为www.mydomain.com/about。.htaccess rewrite = 404页面
基于一些博客阅读,
在这里我有什么对我的httpd.conf
<Directory "var/www/mydomain">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Allow from all
Order allow, deny
RewriteEngine On
</Directory>
我的.htaccess文件
Order deny,allow
DirectoryIndex index.php
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^([^/]+)/$ $1.php
RewriteRule ^([^/]+)/([^/]+)/$ /$1/$2.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]{1,5}|/)$
RewriteRule (.*)$ /$1/ [R=301,L]
www.mydomain.com/about.php仍然有效,但/ about有404 URL未找到页面。
上述配置有问题吗?
P两次尝试均显示404个URL未找到页面。 – hangee
对不起,我编辑了代码。再试一次 –
仍显示404页面。 – hangee