在 Wordpress 上,每当我去
http://sawebdev01/company/news-events/press-releases/press-release/pr.php?pr=170
而不是得到
http://sawebdev01/company/news-events/press-releases/press-release/170
我明白了
http://sawebdev01/wp-content/themes/twentytwelve/page-templates/170%20HTTP/1.1
我想知道发生了什么以及如何将其改回
http://sawebdev01/company/news-events/press-releases/press-release/170
我的 .htaccess 看起来像这样。我知道它已正确配置,因为它昨天工作。它可能与php或服务器有关
RewriteEngine On
RewriteBase /
RewriteCond %{THE_REQUEST} /wp-content/themes/twentytwelve/page-templates/pr.php\?pr=([^&]+) [NC]
RewriteRule .* /wp-content/themes/twentytwelve/page-templates/%1? [R=301,L]
RewriteCond %{REQUEST_URI} !pr\.php [NC]
RewriteCond %{REQUEST_URI} ^/wp-content/themes/twentytwelve/page-templates/([^/]+)/ [NC]
RewriteRule .* /wp-content/themes/twentytwelve/page-templates/pr.php?pr=%1 [L,NC]
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
这是我的标题:
X-Pingback: http://sawebdev01/xmlrpc.php
Pragma: no-cache
Date: Tue, 04 Jun 2013 23:09:25 GMT
Server: Apache/2.2.15 (CentOS) DAV/2 PHP/5.4.10 mod_ssl/2.2.15 OpenSSL/1.0.0-fips mod_wsgi/3.2 Python/2.6.6 mod_perl/2.0.4 Perl/v5.10.1
X-Powered-By: PHP/5.4.10
Transfer-Encoding: chunked
Content-Type: text/html; charset=UTF-8
Cache-Control: no-cache, must-revalidate, max-age=0
Connection: close
Expires: Wed, 11 Jan 1984 05:00:00 GMT
我已经检查了我们 linux 系统中的服务器 access_log。我应该有这个确定请求成功的日志序列:
10.0.0.1 - - [03/Jun/2013:09:48:13 -0700] "GET /company/news-events/press-releases/press-release/?pr=169 HTTP/1.1" 500 - "-" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.94 Safari/537.36"
10.0.0.1 - - [03/Jun/2013:09:48:13 -0700] "GET /favicon.ico HTTP/1.1" 200 - "-" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.94 Safari/537.36"
相反,我得到了这个序列。第一行很好,但第二行不应该存在:
10.0.0.1 - - [04/Jun/2013:09:21:09 -0700] "GET /wp-content/themes/twentytwelve/page-templates/pr.php?pr=169 HTTP/1.1" 301 286 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.94 Safari/537.36"
10.0.0.1 - - [04/Jun/2013:09:21:09 -0700] "GET /wp-content/themes/twentytwelve/page-templates/169%20HTTP/1.1 HTTP/1.1" 200 44820 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.94 Safari/537.36"
10.0.0.1 - - [04/Jun/2013:09:21:11 -0700] "GET /favicon.ico HTTP/1.1" 200 - "-" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.94 Safari/537.36"
如何摆脱此 URL 上的HTTP%201.1?
http://sawebdev01/wp-content/themes/twentytwelve/page-templates/170%20HTTP/1.1