I suck at this. $5 (paypal) to whomever can fix my mod_rewrite.

Discussion in 'Apache' started by andheresjohnny, Sep 28, 2006.

  1. #1
    I will send $5 to the paypal address of anyone who can show me how to do the following:

    I have multiple pages in a subdomain that I would like to 301 redirect to another page in the same subdomain.


    I have many pages in a subdomain like the following:

    subdomain.domain.com/SurveysAAA.htm
    subdomain.domain.com/SurveysBBB.htm
    subdomain.domain.com/SurveysCCC.htm
    subdomain.domain.com/SurveysDDD.htm
    subdomain.domain.com/SurveysBackup1.htm
    subdomain.domain.com/SurveysBackup2.htm


    What I want is for EACH page of the format "subdomain.domain.com/Surveys(whatever).htm" to permanently go to page:

    "subdomain.domain.com/Surveys.htm"


    So:

    subdomain.domain.com/SurveysAAA.htm --> subdomain.domain.com/Surveys.htm

    subdomain.domain.com/SurveysBBB.htm --> subdomain.domain.com/Surveys.htm

    subdomain.domain.com/SurveysCCC.htm --> subdomain.domain.com/Surveys.htm

    subdomain.domain.com/SurveysDDD.htm --> subdomain.domain.com/Surveys.htm

    subdomain.domain.com/SurveysBackup1.htm --> subdomain.domain.com/Surveys.htm

    subdomain.domain.com/SurveysBackup2.htm --> subdomain.domain.com/Surveys.htm

    etc ...



    I do not want subdomain.domain.com/Surveys.htm to be redirected to subdomain.domain.com/Surveys.htm (useless?)


    My latest version of the .htaccess file is:

    Options +Indexes
    Options +FollowSymlinks
    RewriteEngine on
    RewriteCond %{HTTP_HOST} subdomain\.domain\.com
    RewriteRule ^Surveys(.+).htm$ http://subdomain.domain.com/Surveys.htm [R=301,L]


    As you can probably tell, I have tried to modify something I found online. I have no clue to what I'm doing. I tried placing the .htaccess file in the domain root and the subdomain root. No matter what I do, nothing happens. No redirects, no errors ... nothing.


    I would greatly appreciate any help with this. As I said at the top of this post, I will send $5 to the paypal address of the first person who can show me how to do this, or whose response leads me to do this.

    Thank you.
     
    andheresjohnny, Sep 28, 2006 IP
  2. crazyryan

    crazyryan Well-Known Member

    Messages:
    3,087
    Likes Received:
    165
    Best Answers:
    0
    Trophy Points:
    175
    #2
    RewriteRule ^/Surveys(.*)$ /Surveys.htm [R=301,L]
     
    crazyryan, Sep 28, 2006 IP
  3. andheresjohnny

    andheresjohnny Well-Known Member

    Messages:
    964
    Likes Received:
    31
    Best Answers:
    0
    Trophy Points:
    120
    #3
    I tried as you suggested:

    Options +Indexes
    Options +FollowSymlinks
    RewriteEngine on
    RewriteCond %{HTTP_HOST} subdomain\.domain\.com
    RewriteRule ^/Surveys(.*)$ /Surveys.htm [R=301,L]

    Unfortunately it didn't work (no difference). I placed the .htaccess file in the root of the subdomian.

    I appreciate your help though.
     
    andheresjohnny, Sep 28, 2006 IP
  4. Pat Gael

    Pat Gael Banned

    Messages:
    1,331
    Likes Received:
    68
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I think I have the answer, check your pm
     
    Pat Gael, Sep 28, 2006 IP
  5. SoKickIt

    SoKickIt Active Member

    Messages:
    305
    Likes Received:
    30
    Best Answers:
    0
    Trophy Points:
    70
    #5
    SoKickIt, Sep 28, 2006 IP
  6. andheresjohnny

    andheresjohnny Well-Known Member

    Messages:
    964
    Likes Received:
    31
    Best Answers:
    0
    Trophy Points:
    120
    #6
    This worked! Thank you very much.

    I'd be happy to pay you the $5. If you're interested please PM me your paypal address.



    RYANNNNN, BasedSolutions,

    Thank you for responding.
     
    andheresjohnny, Sep 28, 2006 IP