www.webdeveloper.com
Results 1 to 4 of 4

Thread: Help with .htaccess

Hybrid View

  1. #1
    Join Date
    Nov 2013
    Posts
    1

    Help with .htaccess

    Hi,
    I'm currently trying to redirect the old pages from a wordpress site to the new pages on a new site. My .htaccess is letting me down badly though. The main redirect works, but nothing else will. It directs as shown in the example below...

    My .htaccess looks like this:

    Code:
    Redirect 301 / http://www.newsite.com <------ works
    Redirect 301 /about-us http://www.newsite.com/about-us <------- directs to http://www.newsite.comabout-us
    Redirect 301 /product-info http://www.newsite.com/our-services
    Redirect 301 /networking-and-communications http://www.newsite.com/our-services/network-as-a-service
    Redirect 301 /cloud-computing http://www.newsite.com/our-services/infrastructure-as-a-service
    Redirect 301 /business-support http://www.newsite.com/our-services/service-support
    Redirect 301 /business-continuity http://www.newsite.com/our-services/professional-services
    Redirect 301 /onsite-devices http://www.newsite.com/our-services/hardware-as-a-service
    Redirect 301 /applications http://www.newsite.com/our-services/software-as-a-service
    Redirect 301 /case-studies http://www.newsite.com/our-case-studies
    Redirect 301 /the-cloud http://www.newsite.com/our-services/infrastructure-as-a-service
    Redirect 301 /blog http://www.newsite.com/blog
    Does anyone know where am I going wrong?

  2. #2
    Join Date
    Oct 2013
    Location
    3rd planet from the sun
    Posts
    163
    This is the cleanest way to redirect a URL. Quick, easy, and search-engine friendly. Remember HTAccess stuff is for Apache servers only.
    Redirect a single page

    Redirect 301 /oldpage.html http://www.yoursite.com/newpage.html
    Redirect 301 /oldpage2.html http://www.yoursite.com/folder/

    Redirect an entire site

    This way does it with links intact. That is www.oldsite.com/some/crazy/link.html will become www.newsite.com/some/crazy/link.html. This is extremely helpful when you are just "moving" a site to a new domain. Place this on the OLD site:

    Redirect 301 / http://newsite.com/

  3. #3
    Join Date
    Nov 2013
    Location
    new york
    Posts
    62
    You should follow the steps which are clear mentioned in WordPress help forum.
    If you do small mistake also it will not come.
    I have faced this problem earlier.
    Don't worry just check out the procedure once again.

  4. #4
    Join Date
    Oct 2012
    Location
    /dev/null
    Posts
    15
    I had a similar issue with that, for this line:
    Redirect 301 /about-us http://www.newsite.com/about-us <------- directs to http://www.newsite.comabout-us

    you could go to your newsite.com htaccess file and write a new htaccess line:

    Redirect 301 http://www.newsite.comabout-us /about-us

    the idea is write your rule first on the old site , then if that redirection fails, go to the new site htaccess file and write that error URL and correct it there.

    this worked for me on some urls that i just couldnt figure out why they were wrong after spending lots of time trying different htaccess tricks.

    i now this is not the cleanest way to do that, if someone finds something better please reply to this thread.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles