1

我有一个网站出现在报纸上,他们已经发布了我的地址......

www.mysite.com/about.php。

如果您访问上面的 404 作为dotphp 的末尾...

htaccess 中有没有办法可以将其重定向到正确的页面?

当前的 htaccess

RewriteEngine On

RewriteRule ^(.*)\.php\. $1.php

RewriteRule ^people/([^/]*)/([^/]*)/([^/]*)$ /profile.php?county=$1&name=$2&id=$3 [L]
RewriteRule ^people-in-(.*) /people.php?county=$1 [L]

RewriteEngine On
RewriteCond %{HTTP_HOST} ^mysite\.co.uk$
RewriteRule (.*) http://www.mysite.co.uk/$1 [R=301,L]
RewriteCond %{REQUEST_URI} ^/index.php$
RewriteRule (.*) / [R=301,L]

DirectoryIndex index.php

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /blog/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /blog/index.php [L]
</IfModule>


ErrorDocument 404 /notfound.php 
4

3 回答 3

1

RewriteRule可以解决问题:

RewriteRule (.*\.php)\.$ /$1 [R=301,L]
于 2013-08-28T20:00:01.720 回答
0

这应该有效:

RewriteRule ^(.*)\.php\. $1.php
于 2013-08-28T19:41:30.090 回答
0

尝试这个:

RewriteEngine On
RewriteRule ^(.*)\.php\.$ $1.php [L]
于 2013-08-28T19:41:48.130 回答