301 Redirect help

by 3 replies
4
Hi,
Hope someone can help me put
I want to move my store to domain.com/store folder
how do i use 301 redirects to redirect to new location?
also can i place a blog on the root?
and if someone types domain.com they go to domain.com
but any indexed pages are redirected to the new /store folder

I hope I make sense!

Thanks
#programming #301 #redirect
  • You can put this PHP code on all code which is not on "/store".

    PHP Code:
    <?php
    header
    ('Location: http://www.domain.com/store'true301);
    ?>
    However there is .htaccess alternative.
  • Your actual store scripts are probably referencing relative paths so it might not be a problem to move the entire store script to the /store folder.

    You could probably just use a .htaccess and apache mod-rewrite. I'm assuming you're running apache.

    Here's a very simple example of a redirect using mod_rewrite

    Options +FollowSymLinks
    RewriteEngine on
    Redirect 301 /index.html /store
  • create a .htaccess file on your initial store folder & paste in it the following :

Next Topics on Trending Feed