• Welcome to Overclockers Forums! Join us to reply in threads, receive reduced ads, and to customize your site experience!

redirect short url to a long url. htaccess

Overclockers is supported by our readers. When you click a link to make a purchase, we may earn a commission. Learn More.

chetanmadaan

New Member
Joined
Jun 20, 2011
we have a long url which we send to users in email and sometimes they have problems clicking it. so, we want to shorten the url to something in few characters.


long url: index.php?option=vm&page=downloads&product_id=6&file_name=soft.exe&id=XXXX

the XXXX will be the download id per customer.

short url: www.oursite.com/pdownload?XXXX

is there a htaccess redirect we can do here??

Thanks
 
Something like the following might work, assuming no other portions of the redirect URL change, like "product_id=".

RewriteRule ^pdownload(.*) /index.php?option=vm&page=downloads&product_id=6&fi le_name=soft.exe&id=$1
 
I have been looking into an understanding of the possibility's of htaccess including rewriting myself. I have not looked this over totally or tried anything yet but just found this tidbit here to play with!

I am a tough critic though usually only giving a webpage a 10 second look-over but here it is. http://www.evolt.org/ultimate_htaccess_examples
 
Back