Jump to content

Как в .htaccess сделать редирект с одного домена на другой?


Recommended Posts

Есть 2 домена: best-shop.whostii.com и vinama.ru. Нужно сделать редирект с best-shop.whostii.com на vinama.ru.  Что нужно прописать в .htaccess (в папке с сайтом best-shop.whostii.com) чтобы был редирект с best-shop.whostii.com на vinama.ru,

 

есть ли другие способы пере направления ?

 

вот мой .htaccess


# DO NOT REMOVE THIS LINE AND THE LINES BELOW REDIRECTID:edezebaguB
RewriteEngine on
RewriteCond %{HTTP_HOST} ^best-shop.whostii.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.best-shop.whostii.com$
RewriteRule ^$ http://vinama.ru [R=301,L]
# DO NOT REMOVE THIS LINE AND THE LINES ABOVE edezebaguB:REDIRECTID



AddDefaultCharset UTF-8

Options +FollowSymLinks
Options -Indexes

RewriteEngine on

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

#apache2ctl -M && sudo a2enmod expires && sudo service apache2 restart (to enable mod_expires on ubuntu)
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access 7 days"
ExpiresByType image/gif "access plus 1 year"
ExpiresByType image/jpeg "access plus 1 year"
ExpiresByType image/png "access plus 1 year"
ExpiresByType image/jpg "access plus 1 year"
ExpiresByType image/x-icon "access 1 year"
ExpiresByType application/x-shockwave-flash "access 1 year"
ExpiresByType application/javascript "access 1 year"
ExpiresByType application/x-javascript "access 1 year"
ExpiresByType text/css "access 1 year"
ExpiresByType text/html "access 1 year"
</IfModule>

RewriteRule ^(.*)\.tpl$ [R=404]
RewriteRule ^(.*)\.zip$ [R=404]

RewriteCond $1 !^(index\.php|user_guide|uploads/.*|favicon\.ico|favicon\.png|captcha/.*|application/modules/.*/templates|application/modules/.*/assets/js|application/modules/.*/assets/css|application/modules/.*/assets/images|CHANGELOG.xml|templates|js|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]

####################################
# or
# RewriteRule ^(.+)$ index.php?$1 [L]
# or
# RewriteRule ^(.*)$ /index.php?/$1 [L,QSA]

Link to post
Share on other sites

Есть вопрос? Задай его профессиональным веб-мастерам, SEO и другим специалистам!

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...