Redirection problem

Discussion in 'Programming' started by Prachi4Webdev, Oct 22, 2009.

  1. #1
    Hi
    Few days back I bought a domain. And planned to start a blog First. So I started like sitename.com/blog/

    As I dont want to start the main site i.e. - sitename.com so I tried to redirect it to my blog i.e. - sitename.com/blog/ . But the code not working.

    Btw my blog is in WP.

    Can anybody help me with this issue?

    Help would be appreciated.

    Admin pls sift this post if I posted my queries in wrong forums.

    Thanks
    Prachi
     
    Prachi4Webdev, Oct 22, 2009 IP
  2. Prachi4Webdev

    Prachi4Webdev Guest

    Messages:
    133
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Pls share if any of you know the answer.

    Waiting......

    Thanks
     
    Prachi4Webdev, Oct 22, 2009 IP
  3. rogan4567

    rogan4567 Active Member

    Messages:
    103
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    55
    #3
    Most likely you installed the blog in the visible main directory (public_html htdocs www, etc) and not in the blog subdirectory.

    I'm not sure how your server is setup or what it's using, but on linux, if I wanted to install Wordpress at sitename.com/blog on my hosting account, internally all the blogs files would be inside:

    /home/username/public_html/blog/

    not

    /home/username/public_html/

    If I were to do it on my Windows dev server, it would be:

    D:/web/htdocs/sitename/blog/

    Not
    D:/web/htdocs/sitename/
     
    rogan4567, Oct 22, 2009 IP
  4. Prachi4Webdev

    Prachi4Webdev Guest

    Messages:
    133
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Thanks rogan I will try your solutions.
     
    Prachi4Webdev, Oct 22, 2009 IP
  5. FCM

    FCM Well-Known Member

    Messages:
    669
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    155
    #5
    Since you are using Wp that means you have php and since you have php you should do the following.

    In your root folder eg.) the first folder www/ not www/blog find your index.php file if you have one. If you do not have one create one. If you don't know how to create one open up notepad and save as index.php and click All Files and save. Inside of the file type in the following code

    <?php
    Header("Location: http://www.myurl.com/blog");
    ?>

    This will redirect to your blog

    Why not create a subdomain? It would be a lot easier. blog.mydomain.com
     
    FCM, Oct 22, 2009 IP