Redirecting pages 301

Redirecting pages 301

Redirecting pages 301

<

.htaccess

You have several methods you can use to redirect pages.

Open up .htaccess in the file dir with FTP program.

For single redirects you can use:

Redirect /oldfolder/ /newfolder/
Redirect /oldfolder2 /newfolder

It must start with / for both from and to.

To redirect folders and wildcards:

Again it has to start with / for both from and to

RedirectMatch 301 ^/olddir/ /newdir

 

#This will direct for example mypage.com/oldproduktpage/shoes/ to newpage.com/
newproductpage/shoes/

RedirectMatch 301 /oldproduktpage/(.*) /newproductpage/$1

#Match any sequence before with ^ so mypage.com/2014/shoes/ becomes newpage.com/newfolder/

RedirectMatch 301 ^/2014/.*$ /newfolder/

 

 

This post is also available in: Norsk bokmål