...

View Full Version : Need help! .htaccess best method, and url vars



Andy87
10-03-2008, 01:00 PM
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.

mbannonb
10-10-2008, 12:17 AM
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



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum