我使用.htaccess创建干净的网址。 这里是一片.htaccess文件的:干净的URL与.htaccess但只有一个网址
Options +FollowSymLinks -MultiViews
RewriteEngine On
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{REQUEST_URI} !(/$|\.)
RewriteRule (.*) %{REQUEST_URI}/ [R=301,L]
RewriteRule ^posts/page/([0-9]+)/$ posts.php?page=$1
RewriteRule ^posts posts.php
它工作正常,但问题是这两个URL工作! 有没有办法只做site.com/posts/工作,并在site.com/posts.php上返回'not found'(或重定向到site.com/posts/)
想想我读了两处地址对于相同的页面对于seo不利。
now/posts/returns 404 too。无论如何,只有使/posts.php返回404? – theboy