我有一个域名 abc.ca已经在运行&谷歌爬了那个网址。如何从一个域重定向到另一个域?
现在,我要为 abc.com
所以,我怎么能管理所有URL abc.ca的公司 - > abc.com
使用htacees。网站建立在PHP Joomla。
abc.ca/def.html - > abc.com/def.html
有数千页。我不能在htaccess中编写个人301重定向。
我们可以在PHP
最好是PHP的网站或htaccess的网站做这样做呢?
我有一个域名 abc.ca已经在运行&谷歌爬了那个网址。如何从一个域重定向到另一个域?
现在,我要为 abc.com
所以,我怎么能管理所有URL abc.ca的公司 - > abc.com
使用htacees。网站建立在PHP Joomla。
abc.ca/def.html - > abc.com/def.html
有数千页。我不能在htaccess中编写个人301重定向。
我们可以在PHP
最好是PHP的网站或htaccess的网站做这样做呢?
你可以试试这个:
RewriteCond %{HTTP_HOST} !^www\.abc.\.com
RewriteRule ^(.*)$ http://www.abc.com/$1 [R=permanent,L]
我没有测试它,但它应该是这样的:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^abc.ca$ [OR]
RewriteCond %{HTTP_HOST} ^www.abc.ca$
RewriteRule (.*)$ http://www.abc.com/$1 [R=301,L]
Redirect 301 /old/old.htm http://www.domain.com/new.htm
否则你可能想看看这个question
试试这个
<FilesMatch "\.(tpl|ini|log)">
Order deny,allow
Deny from all
</FilesMatch>
RewriteBase/
RewriteRule ^sitemap.xml$ index.php?route=feed/google_sitemap [L]
RewriteRule ^googlebase.xml$ index.php?route=feed/google_base [L]
RewriteRule ^download/(.*) /index.php?route=error/not_found [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !.*\.(ico|gif|jpg|jpeg|png|js|css)
RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]
在这里你可以将RewriteBase /
修改为您的域名。 对于你可以给这个子域RewriteBase /subfolder