Htaccess 301重定向外部域问题

时间:2015-10-03 06:25:58

标签: .htaccess redirect

基本上我使用注册商将域名重定向到另一个域名[example.org],然后我尝试使用[example.org]上的htaccess重定向某些内部页面

问题1:我试图重定向

  

ES / notice.php?FILE = news.php

  

ES /

但即使重定向有效,现在它显示为

  

ES /?FILE = news.php

问题2:单个页面的重定向(e.x; len.php到/ es /)仍然不起作用,显示404

# Use PHP5.4 as default
AddHandler application/x-httpd-php54 .php

RewriteEngine On

Options -MultiViews
RewriteEngine On
RewriteBase /

Options +FollowSymLinks
RewriteRule ^/?pricing$ http://example.org/buy-stuff [R=301,L]
RewriteRule ^/?stuff-tour$ http://example.org/stuff-stuff-tour [R=301,L]
RewriteRule ^/?fr/stuff-tour$ http://example.org/stuff-stuff-tour [R=301,L]
RewriteRule ^/?es/notice.php$ http://example.org/es/ [R=301,L]
RewriteRule ^/?len.php$ http://example.org/es/ [R=301,L]
RewriteRule ^/?latest-blog-posts$ http://example.org/blog [R=301,L]

RewriteRule ^/?por/(.*)$ http://example.org/es/ [R=301,L]
RewriteRule ^/?nl/(.*)$ http://example.org/ [R=301,L]
RewriteRule ^/?it/(.*)$ http://example.org/ [R=301,L]

#ErrorDocument 404 /

RewriteCond %{THE_REQUEST} \.htm
RewriteRule ^(.*)\.htm$ /$1 [R=301,L]

RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]

#RewriteCond %{HTTP_HOST} ^www.example.org$ [NC]
#RewriteRule ^(.*)$ http://example.org$1 [R=301,L]

#RewriteRule ^([A-Za-z]+)/([A-Za-z]+)$  $1/$2.htm [NC,L]
#RewriteRule ^([A-Za-z]+)$ $1.htm [NC,L]

RewriteCond %{REQUEST_FILENAME} !-d 
RewriteCond %{REQUEST_FILENAME}\.htm -f  
RewriteRule ^([A-Za-z\-]+)$  $1.htm

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{HTTP_HOST} !^\.localhost$ [NC]
RewriteRule ^(.+[^/])/$ http://%{HTTP_HOST}/$1 [R=301,L]

<FILES .htaccess>
order allow,deny 
deny from all
</FILES>

Options -Indexes 
IndexIgnore *.zip *.txt

0 个答案:

没有答案