我在8080上有我的apache服务器端口,对于wordpress页面友好的URL我设置.htaccess如下。
我在/ var / www / html / wordpress目录中关注了.htaccess。
Options +FollowSymlinks
RewriteEngine on
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /wordpress/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /wordpress/index.php [L]
</IfModule>
# END WordPress
现在我已将端口更改为80.但是Web浏览器正在重定向到8080端口,因此我无法从wordpress服务该页面。
我也在下面尝试过.htaccess
Options +FollowSymlinks
RewriteEngine on
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{SERVER_PORT} !^8080$
RewriteRule .? - [S=1]
RewriteRule (.*) http://${HTTP_HOST}/$1 [L,R,NE]
RewriteBase /wordpress/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /wordpress/index.php [L]
</IfModule>
# END WordPress
但浏览器仍然(清除缓存后)继续转到8080端口。
使用端口8080的网址是:
http://49.40.2.94:8080/wordpress/frequently-asked-questions/
更改为端口80后,它仍然会被重定向到
http://49.40.2.94:8080/wordpress/frequently-asked-questions/
即使我输入:
http://49.40.2.94/wordpress/frequently-asked-questions/
所以没有端口8080的陈旧网址我想停止它,因为服务器不再使用8080。
此后一天左右,我需要开始使用FQDN进行IP。 url中的更改是否会影响mod_rewrite规则?
尝试了解建议之后的结果:我从浏览器中清除了缓存,但重定向到8080的结果相同。
Options +FollowSymlinks
RewriteEngine on
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /wordpress/
RewriteCond %{SERVER_PORT} !^8080$
RewriteRule .? - [S=1]
RewriteRule (.*) http://${HTTP_HOST}/$1 [L,R,NE]
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /wordpress/index.php [L]
</IfModule>
# END WordPress
100.112.28.145 - - [13/Aug/2014:15:33:09 +0530] "GET /cgi-bin/productpage.py HTTP/1.1" 200 1941 "-" "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.125 Safari/537.36"
100.112.28.145 - - [13/Aug/2014:15:33:09 +0530] "GET /css/main.css HTTP/1.1" 200 4204 "http://49.40.2.94/cgi-bin/productpage.py" "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.125 Safari/537.36"
100.112.28.145 - - [13/Aug/2014:15:33:09 +0530] "GET /js/main.js HTTP/1.1" 200 345 "http://49.40.2.94/cgi-bin/productpage.py" "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.125 Safari/537.36"
100.112.28.145 - - [13/Aug/2014:15:33:09 +0530] "GET /images/jio-logo.png HTTP/1.1" 200 5315 "http://49.40.2.94/cgi-bin/productpage.py" "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.125 Safari/537.36"
100.112.28.145 - - [13/Aug/2014:15:33:09 +0530] "GET /images/wifi-icon.png HTTP/1.1" 200 1354 "http://49.40.2.94/cgi-bin/productpage.py" "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.125 Safari/537.36"
100.112.28.145 - - [13/Aug/2014:15:33:09 +0530] "GET /js/jquery-1.10.2.min.js HTTP/1.1" 200 93113 "http://49.40.2.94/cgi-bin/productpage.py" "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.125 Safari/537.36"
100.112.28.145 - - [13/Aug/2014:15:33:09 +0530] "GET /images/offers-icon.png HTTP/1.1" 200 942 "http://49.40.2.94/cgi-bin/productpage.py" "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.125 Safari/537.36"
100.112.28.145 - - [13/Aug/2014:15:33:09 +0530] "GET /images/discover-icon.png HTTP/1.1" 200 858 "http://49.40.2.94/cgi-bin/productpage.py" "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.125 Safari/537.36"
100.112.28.145 - - [13/Aug/2014:15:33:09 +0530] "GET /images/android-icon.png HTTP/1.1" 200 3447 "http://49.40.2.94/cgi-bin/productpage.py" "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.125 Safari/537.36"
100.112.28.145 - - [13/Aug/2014:15:33:09 +0530] "GET /js/jquery.mobile-1.4.3.min.js HTTP/1.1" 200 198126 "http://49.40.2.94/cgi-bin/productpage.py" "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.125 Safari/537.36"
100.112.28.145 - - [13/Aug/2014:15:33:09 +0530] "GET /images/apple-icon.png HTTP/1.1" 200 1475 "http://49.40.2.94/cgi-bin/productpage.py" "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.125 Safari/537.36"
100.112.28.145 - - [13/Aug/2014:15:33:10 +0530] "GET /images/landscape-bg.png HTTP/1.1" 200 609231 "http://49.40.2.94/cgi-bin/productpage.py" "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.125 Safari/537.36"
100.112.28.145 - - [13/Aug/2014:15:33:17 +0530] "GET /wordpress/frequently-asked-questions/ HTTP/1.1" 301 - "http://49.40.2.94/cgi-bin/productpage.py" "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.125 Safari/537.36"
100.112.3.35 - - [13/Aug/2014:15:41:27 +0530] "GET /cgi-bin/productpage.py HTTP/1.1" 200 1703 "-" "Mozilla/5.0 (Linux; Android 4.2.1; Micromax A116 Build/JOP40D) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.131 Mobile Safari/537.36"
100.112.3.35 - - [13/Aug/2014:15:41:27 +0530] "GET /css/main.css HTTP/1.1" 200 4204 "http://49.40.2.94/cgi-bin/productpage.py" "Mozilla/5.0 (Linux; Android 4.2.1; Micromax A116 Build/JOP40D) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.131 Mobile Safari/537.36"
100.112.3.35 - - [13/Aug/2014:15:41:27 +0530] "GET /js/main.js HTTP/1.1" 200 345 "http://49.40.2.94/cgi-bin/productpage.py" "Mozilla/5.0 (Linux; Android 4.2.1; Micromax A116 Build/JOP40D) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.131 Mobile Safari/537.36"
100.112.3.35 - - [13/Aug/2014:15:41:27 +0530] "GET /images/jio-logo.png HTTP/1.1" 200 5315 "http://49.40.2.94/cgi-bin/productpage.py" "Mozilla/5.0 (Linux; Android 4.2.1; Micromax A116 Build/JOP40D) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.131 Mobile Safari/537.36"
100.112.3.35 - - [13/Aug/2014:15:41:27 +0530] "GET /images/wifi-icon.png HTTP/1.1" 200 1354 "http://49.40.2.94/cgi-bin/productpage.py" "Mozilla/5.0 (Linux; Android 4.2.1; Micromax A116 Build/JOP40D) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.131 Mobile Safari/537.36"
100.112.3.35 - - [13/Aug/2014:15:41:27 +0530] "GET /js/jquery-1.10.2.min.js HTTP/1.1" 200 93113 "http://49.40.2.94/cgi-bin/productpage.py" "Mozilla/5.0 (Linux; Android 4.2.1; Micromax A116 Build/JOP40D) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.131 Mobile Safari/537.36"
100.112.3.35 - - [13/Aug/2014:15:41:27 +0530] "GET /images/offers-icon.png HTTP/1.1" 200 942 "http://49.40.2.94/cgi-bin/productpage.py" "Mozilla/5.0 (Linux; Android 4.2.1; Micromax A116 Build/JOP40D) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.131 Mobile Safari/537.36"
100.112.3.35 - - [13/Aug/2014:15:41:27 +0530] "GET /images/discover-icon.png HTTP/1.1" 200 858 "http://49.40.2.94/cgi-bin/productpage.py" "Mozilla/5.0 (Linux; Android 4.2.1; Micromax A116 Build/JOP40D) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.131 Mobile Safari/537.36"
100.112.3.35 - - [13/Aug/2014:15:41:27 +0530] "GET /images/android-icon.png HTTP/1.1" 200 3447 "http://49.40.2.94/cgi-bin/productpage.py" "Mozilla/5.0 (Linux; Android 4.2.1; Micromax A116 Build/JOP40D) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.131 Mobile Safari/537.36"
100.112.3.35 - - [13/Aug/2014:15:41:27 +0530] "GET /js/jquery.mobile-1.4.3.min.js HTTP/1.1" 200 198126 "http://49.40.2.94/cgi-bin/productpage.py" "Mozilla/5.0 (Linux; Android 4.2.1; Micromax A116 Build/JOP40D) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.131 Mobile Safari/537.36"
100.112.3.35 - - [13/Aug/2014:15:41:28 +0530] "GET /images/portrait-bg.png HTTP/1.1" 200 692885 "http://49.40.2.94/cgi-bin/productpage.py" "Mozilla/5.0 (Linux; Android 4.2.1; Micromax A116 Build/JOP40D) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.131 Mobile Safari/537.36"
100.112.3.35 - - [13/Aug/2014:15:41:28 +0530] "GET /favicon.ico HTTP/1.1" 404 286 "-" "Mozilla/5.0 (Linux; Android 4.2.1; Micromax A116 Build/JOP40D) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.131 Mobile Safari/537.36"
100.112.3.35 - - [13/Aug/2014:15:41:34 +0530] "GET /wordpress/frequently-asked-questions/ HTTP/1.1" 301 - "http://49.40.2.94/cgi-bin/productpage.py" "Mozilla/5.0 (Linux; Android 4.2.1; Micromax A116 Build/JOP40D) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.131 Mobile Safari/537.36"
此致
米滕。
答案 0 :(得分:2)
在&#34; RewriteEngine On&#34;之后放置RewriteBase;值。
答案 1 :(得分:0)
这是wordpress问题。这些设置具有使用端口8080的siteurl和home设置。
。Wordpress port redirect error这个网址有助于解决。