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.

URL Rredirecting Using .htaccess

Discussion in 'Apache' started by Nina Rose, Feb 19, 2015.

  1. #1
    How do i redirect URL: example.com/page1 to example.com

    I mean, i want to redirect any specific page of my site to homepage.

    Please Help.

    Thank You.
    SEMrush
     
    Nina Rose, Feb 19, 2015 IP
    SEMrush
  2. Profitup

    Profitup Greenhorn

    Messages:
    50
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    13
    #2
    Add this string to your .htaccess file:

    Redirect 301 /example.com/page1 http://www.example.com/
     
    Profitup, Feb 19, 2015 IP
  3. nasium

    nasium Active Member

    Messages:
    114
    Likes Received:
    4
    Best Answers:
    1
    Trophy Points:
    90
    #3
    RewriteEngine on
    RewriteCond %{REQUEST_URI} !/$
    RewriteRule (.*) / [R=301,L]
    Code (markup):
     
    nasium, Mar 16, 2015 IP
  4. Blesta.Store

    Blesta.Store Active Member

    Messages:
    97
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    80
    #4
    I use PHP.
    <?php
    header("Location: ../
    die();
    ?>
    
    or
    
    <?php
    header("Location: http://url.com
    die();
    ?>
    Code (markup):
     
    Blesta.Store, Apr 21, 2015 IP