1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

301 redirect of multiple page to a single page

Discussion in 'BlackHat Lounge' started by DARKF3D3, Oct 11, 2014.

  1. DARKF3D3

    DARKF3D3 Newbie

    Joined:
    Nov 30, 2011
    Messages:
    0
    Likes Received:
    0
    Hi, I'm trying to redirect through htaccess file all these pages:
    HTML:
    old-website.it/my-page
    old-website.it/my-page?&p=2
    old-website.it/my-page?&p=3
    old-website.it/my-page?&p=4
    old-website.it/my-page?&p=...
    old-website.it/my-page?&p=...
    old-website.it/my-page?&p=...
    old-website.it/my-page?&p=x

    To this page on a new domain:
    HTML:
    new-website.it/my-page

    Someone know how can i do that?
     
  2. remon24

    remon24 Regular Member

    Joined:
    Oct 3, 2012
    Messages:
    497
    Likes Received:
    404
    Location:
    NEW DELHI
  3. m7shsh

    m7shsh Junior Member

    Joined:
    Jun 17, 2007
    Messages:
    190
    Likes Received:
    122
    Try

    Code:
    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^www\.old-website\.it$ [NC]  
    RewriteRule ^(.*)$ http://new-website.it/my-page [R=301,L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ 404.html
    and create 404.html file and add inside it this
    Code:
    <head>
    <meta HTTP-EQUIV="refresh" CONTENT="0;URL=http:///new-website.it/my-page">
    </head>
     
  4. DARKF3D3

    DARKF3D3 Newbie

    Joined:
    Nov 30, 2011
    Messages:
    0
    Likes Received:
    0
    Hi m7shsh,
    what's needed for the 404 file?

    I Need a rule to redirect only the home page because for all the other pages I already have a rule that make the redirect.
     
  5. DARKF3D3

    DARKF3D3 Newbie

    Joined:
    Nov 30, 2011
    Messages:
    0
    Likes Received:
    0
    Any help? I haven't yet find a working solution.