Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Oct 2008
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Need help! .htaccess best method, and url vars

    Hello,

    I need to creater shorter URL's for some pages due to the "real" URL's being too long when including them in mail shots.

    For example:

    http://www.mysite.com/editfreeprivatead.php?id=12345

    Would be too long for some peoples email clients (maybe bad example above, but trust me, some are too long, esp. when theres is more URL vars), and it wraps onto two lines, which causes issues with some peoples email clients and disables the URL. With being such a large site and having alot of people receiving emails (50k+) there is a handful of people who keep asking about this issue.

    So my plan is to use a smaller URL and redirect it using .htaccess to the real URL. So, for example we would direct

    http://www.mysite.com/efpa.php?id=12345 to http://www.mysite.com/editfreeprivatead.php?id=12345

    So the email would include the http://www.mysite.com/efpa.php?id=12345 link, and when they follow this link it would redirect (via .htaccess) to the http://www.mysite.com/editfreeprivatead.php?id=12345 page.

    My question is which is the best type of redirect to use? Should it be a permanent 301 redirect? Or should it be a 302 default redirect? Note that the efpa.php page does not actully exist, or has it ever existed, we are just using it to create a smaller URL to redirect from.

    Any input would be great.

    If anybody has any information on adding vars to redirects too, that would be great! i.e. how I go about adding the id=1234 from the efpa.php to the editfreeprivateadvert.php in the .htaccess?

    Thanks alot.

  • #2
    New Coder
    Join Date
    Sep 2004
    Posts
    60
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Andy87 View Post
    Hello,

    I need to creater shorter URL's for some pages due to the "real" URL's being too long when including them in mail shots.

    For example:

    http://www.mysite.com/editfreeprivatead.php?id=12345

    Would be too long for some peoples email clients (maybe bad example above, but trust me, some are too long, esp. when theres is more URL vars), and it wraps onto two lines, which causes issues with some peoples email clients and disables the URL. With being such a large site and having alot of people receiving emails (50k+) there is a handful of people who keep asking about this issue.

    So my plan is to use a smaller URL and redirect it using .htaccess to the real URL. So, for example we would direct

    http://www.mysite.com/efpa.php?id=12345 to http://www.mysite.com/editfreeprivatead.php?id=12345

    So the email would include the http://www.mysite.com/efpa.php?id=12345 link, and when they follow this link it would redirect (via .htaccess) to the http://www.mysite.com/editfreeprivatead.php?id=12345 page.

    My question is which is the best type of redirect to use? Should it be a permanent 301 redirect? Or should it be a 302 default redirect? Note that the efpa.php page does not actully exist, or has it ever existed, we are just using it to create a smaller URL to redirect from.

    Any input would be great.

    If anybody has any information on adding vars to redirects too, that would be great! i.e. how I go about adding the id=1234 from the efpa.php to the editfreeprivateadvert.php in the .htaccess?

    Thanks alot.
    This has a good tut on that: http://corz.org/serv/tricks/htaccess2.php


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •