Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Redirecting to an URL with query string [moved]

Discussion in 'General Discussion' started by DeadManWalking, Jan 12, 2006.

  1. DeadManWalking

    DeadManWalking Active Member

    Joined:
    Dec 9, 2004
    Messages:
    43
    Likes Received:
    0
    Trophy Points:
    156
    Location:
    Japan
  2. rustelekom

    rustelekom Well-Known Member
    PartnerNOC

    Joined:
    Nov 13, 2003
    Messages:
    290
    Likes Received:
    0
    Trophy Points:
    166
    Location:
    moscow
    you cannot redirect url with query string in url using standard cpanel redirect menu. you should look into mod_rewrite technique for realize your requirements. it's not very hard and can done by editing .htaccess file in your web folder. mod_rewrite examples can be found by google.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
    #2 rustelekom, Jan 15, 2006
    Last edited: Jan 15, 2006
  3. danman

    danman Registered

    Joined:
    Mar 9, 2002
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    301
    Location:
    Royal Oak, Michigan, USA
    I tried to edit the .htaccess file and it did not work. This is the first .htaccess file I have ever edited. Well the edit I did below did not work. Does anyone have any ideas what is wrong? This was a guess edit so to speak, I followed the format of the other redirect that was existing in the .htaccess file prior to any editing.


    Also, why does these query urls not work in cPanel redirects?



    **** Old ".htaccess" file ***

    # -FrontPage-

    IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*

    <Limit GET POST>
    order deny,allow
    deny from all
    allow from all
    </Limit>
    <Limit PUT DELETE>
    order deny,allow
    deny from all
    </Limit>
    AuthName www.allaroundweb.com
    AuthUserFile /home/aaweb/public_html/_vti_pvt/service.pwd
    AuthGroupFile /home/aaweb/public_html/_vti_pvt/service.grp




    RedirectMatch temp ^/portal/$ http://allaroundi.com/
    *** EOF ***

    **** New ".htaccess" file ***

    # -FrontPage-

    IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*

    <Limit GET POST>
    order deny,allow
    deny from all
    allow from all
    </Limit>
    <Limit PUT DELETE>
    order deny,allow
    deny from all
    </Limit>
    AuthName www.allaroundweb.com
    AuthUserFile /home/aaweb/public_html/_vti_pvt/service.pwd
    AuthGroupFile /home/aaweb/public_html/_vti_pvt/service.grp




    RedirectMatch temp ^/portal/$ http://allaroundi.com/

    RedirectMatch temp ^/faqs/$ http://allaroundweb.com/forum/index.php?c=3
    *** EOF ***

    I changed that last line to

    Redirect /faqs http://allaroundweb.com/forum/index.php?c=3

    then

    Redirect /faqs "http://allaroundweb.com/forum/index.php?c=3"

    This is close, but it puts a / at the end

    http://allaroundweb.com/forum/index.php?c=3/
    Thank you,

    danman
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
    #3 danman, Feb 7, 2006
    Last edited: Feb 7, 2006
  4. danman

    danman Registered

    Joined:
    Mar 9, 2002
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    301
    Location:
    Royal Oak, Michigan, USA
    Frustrated

    I think I have another way of doing this. I would still like to know why this did not work. Any insight would be apreciated.

    danman
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. AndyReed

    AndyReed Well-Known Member
    PartnerNOC

    Joined:
    May 29, 2004
    Messages:
    2,222
    Likes Received:
    4
    Trophy Points:
    193
    Location:
    Minneapolis, MN
    If /faqs is a directory with files in it:
    Code:
    RedirectMatch ^/faqs/.*$ "http://allaroundweb.com/forum/index.php?c=3"
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice