Internal page redirection without affecting subdomains

Internal page redirection without affecting subdomains

 

When we recently decided to redesign our website, we came across the issue of keeping the visitors flow from our old pages and links. As best practice for SEO, we had to redirect our old links to the new ones. The obvious decision was to simply use “Redirect 301″ in our .htaccess, but that messed up our subdomains.

Redirect 301 ^/index\.php$ /index.html #this would usually do, but not in this case

Redirect 301 ^/index\.php$ /index.html #this would usually do, but not in this case

After some research it became clear that the answer was mod_rewrite (for those of you not familiar with this practice, here is a useful article about url rewriting). The trick was to use a rewrite condition for your root domain, so that the redirection applies only to it.

RewriteEngine on RewriteCond %{HTTP_HOST} ^(www\.)?if-act\.net$ [NC] #this is the condition RewriteRule...
Прочети цялата публикация

Коментари

Tози сайт използва "Бисквитки". Научи повече Приемам

Моля, запознайте се с нашите Общи условия и Политика за поверителност