How to do this on wordpress?

Discussion in 'Blogging' started by g36, Sep 28, 2011.

  1. #1
    Let's say I have wordpress installed on mysite.com/blog. If the user has visited mysite.com/blog and when he wants to visit mysite.com, he's redirected back to mysite.com/blog. I can easily do this on static php page with cookie, but how to do this on wordpress?

    Thanks.

    EDIT: Apparently I posted this thread on wrong section, I didn't know "wordpress" section existed. Mod, would you kindly move this thread to "wordpress" section (http://forums.digitalpoint.com/forumdisplay.php?f=110).
     
    g36, Sep 28, 2011 IP
    Digital_shubhi likes this.
  2. futurepocket

    futurepocket Peon

    Messages:
    94
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Can you clarify what you mean first... you WANT the person to be redirected to mysite.com/blog when they visit mysite.com? Or it's doing that right now and you want to stop it? Use HTACCESS 301 redirect:

    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^(www\.)?domain\.com$
    RewriteCond %{REQUEST_URI} !^/subdirectory/
    RewriteRule ^(.*)$ subdirectory/$1 [L] 
    Code (markup):
     
    futurepocket, Sep 28, 2011 IP
  3. g36

    g36 Peon

    Messages:
    1,024
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #3
    NO, that's not what I want.

    The visitors have visited mysite.com/blog before. They now want to visit mysite.com, when they do, they're redirected to mysite.com/blog. If they haven't visited mysite.com/blog, they're not redirected to mysite.com/blog when they visit mysite.com.
     
    g36, Sep 29, 2011 IP