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.

HTACCESS

Discussion in 'Site & Server Administration' started by amitd, Oct 29, 2016.

  1. #1
    Not able to do it correctly so asking you guys.
    I have a domain with URLs like
    mydomain.com/aus/blog/index8090.html?page_id=115
    mydomain.com/aus/blog/index8090.html?page_id=115
    mydomain.com/aus/blog/index4f61.html?p=66
    mydomain.com/aus/blog/index4f61.html?p=91

    I want to 301 redirect all these pages to mydomain.com/aus/

    How can I do that? Please help me.
    Thanks in advance for your help.
    SEMrush
     
    amitd, Oct 29, 2016 IP
    SEMrush
  2. Dowsons

    Dowsons Greenhorn

    Messages:
    36
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    6
    #2
    Simply find on the web htaccess generator and it will do it for you. It is really easy to find and use.
     
    Dowsons, Nov 2, 2016 IP
  3. Furquan Ahmed

    Furquan Ahmed Banned

    Messages:
    807
    Likes Received:
    74
    Best Answers:
    1
    Trophy Points:
    110
    #3
    //301 Redirect Old File
    Redirect 301 mydomain.com/aus/blog/index8090.html?page_id=115 mydomain.com/aus/
    
    //301 Redirect Entire Directory
    RedirectMatch 301 mydomain.com/aus/blog/index8090.html?page_id=115(.*) mydomain.com/aus//$1
    
    Code (markup):
     
    Furquan Ahmed, Nov 2, 2016 IP
  4. amitd

    amitd Active Member

    Messages:
    27
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    86
    #4
    This doesn't work as the redirection is with query string.
     
    amitd, Nov 2, 2016 IP
  5. amitd

    amitd Active Member

    Messages:
    27
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    86
    #5
    If it would have been that simple, I would not have asked it here. :)
     
    amitd, Nov 2, 2016 IP