1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

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).
    SEMrush
     
    g36, Sep 28, 2011 IP
    Digital_shubhi likes this.
    SEMrush
  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