• hi i want to redirect my old site to my new site but in category of it and it may cause problem in tags

    so how can redirect this urls ??

    site123.com to newsite.net/cate2

    site123.com/tags to newsite.net/tags

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi,
    Just create a .htaccess file. .htaccess file should be at the old website’s root directory. Add two line code to .htaccess file.

    Redirect 301 https://site123.com https://newsite.net/cate2
    Redirect 301 https://site123.com/tags https://newsite.net/tags

    Thanks
    Mohammad

    Thread Starter javadth

    (@javadth)

    is it redirect whole of the links ?

    i want to redirect all of the my old site links to new site

    because i moved posts to new site

    Hi,
    How many unique pages at old site like Home, About, contact, Blog page, Single blog page? It would be better to redirect any link of website to New site home page.

    Thanks
    Mohammad

    Thread Starter javadth

    (@javadth)

    want to redirect all of my old website to my new website

    i moved my old website to my new website category :

    old.com to new.com/category

    but after using 301 redirect code it redirect /tag/ urls to end of old website :

    old.com >> new.com/category

    old.com/tag/testtag >> new.com/category/testtag

    i want to redirect all website posts to that category section and fix tags url problem and they redirect to

    old.com/tag/ new.com/tag/

    Hi

    Have you tried a blanket wild card redirect from the old site to the new site using .htaccess and Apache mod_rewrite.

    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^oldsite\.com$ [OR]
    RewriteCond %{HTTP_HOST} ^www\.oldsite\.com$
    RewriteRule ^(.*)$ "http\:\/\/newsite\.com\/$1" [R=301,L]

    or a simplified rule that will handle redirection of any requests on the old site to the same location on the new site.

    
    Redirect 301 (.*)$ https://newsite.com/$1
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘need to best htaccess code for 301 redirect’ is closed to new replies.