rnmcd Posted March 17, 2005 Posted March 17, 2005 (I'm not sure which forum to post this in, heck I don't even know how to explain what I want to do properly ...so please move accordingly thanks). I want to have a second URL for some pages on my website. Besides the URL that is automatically generated by the file path I want to have a different URL that also takes people to certain pages. For example I would like to have the existing URL: www.example.com/photos/east_coast/november/124.jpg ALSO be reachable by going to: www.example.com/sunrise What I want is to be able to manually create a second URL (for only some pages) that takes people to the same page as the original URL. Anyone know how this could be done? Thank you. Quote
TCH-Andy Posted March 17, 2005 Posted March 17, 2005 Hi, If you just have a small number, and I understand you correctly, the best way is to add a redirect from cpanel. Quote
rnmcd Posted March 17, 2005 Author Posted March 17, 2005 I didn't even know that was possible via cpanel. I'll give it a try. Thank you Andy. Any idea what the cpanel redirect option of "Temporary" versus "Permanent" mean? It looks like the redirect can be removed so neither are truly permanent. Is "Temporary" for one-time use? Thanks. Quote
TCH-Andy Posted March 17, 2005 Posted March 17, 2005 It is more to do with search engines that anything else. If Permanent, most search engines will reset the original link - and just remember the link you have forwarded it to. If Temporary, they will remember both. Quote
rnmcd Posted March 17, 2005 Author Posted March 17, 2005 I'm curious to how the cpanel redirect works....it is making some change to the .htaccess file? Quote
TCH-Bruce Posted March 17, 2005 Posted March 17, 2005 You are correct. It adds redirect statements to the .htaccess file. Quote
rnmcd Posted March 17, 2005 Author Posted March 17, 2005 You are correct. It adds redirect statements to the .htaccess file. <{POST_SNAPBACK}> The cpanel redirect does basically what I need but now we get into my likes...is there a way to have a second URL that redirects but ALSO 'stays' in the browser address? For example I would like to have the existing URL: www.example.com/photos/east_coast/november/124.jpg ALSO be reachable by going to: www.example.com/sunrise AND to have www.example.com/sunrise STAY in the browser's address field. Is this what I've heard referred to as an "alias"? How would this be achieved? Quote
TCH-Andy Posted March 17, 2005 Posted March 17, 2005 We do not support any forms of URL masking at TotalChoice Hosting, which is effectively what you are asking (if I understand you correctly). The reason being, if it were taken to the extreme, such methods could be used to spoof sites for phishing and other such purposes. I would suggest changing it to provide a copy of the file 124.jpg at sunrise. Quote
whoahorse Posted March 17, 2005 Posted March 17, 2005 What about parking the second site? Weezy Quote
rnmcd Posted March 17, 2005 Author Posted March 17, 2005 What about parking the second site? Weezy <{POST_SNAPBACK}> I guess I haven't explained myself properly. There isn't a second site...I just want a shorter URL to some pages on my site. Regarding URL masking, I didn't know that was prohibited. Thanks. Quote
TweezerMan Posted March 17, 2005 Posted March 17, 2005 What is being asked for is possible through the use of mod_rewrite. This particular case is not strictly "URL masking", but mod_rewrite is a powerful tool that can put you in violation of TCH's Terms of Service and Acceptable Use Policy if not used wisely (as TCH-Andy mentions). If you're not sure a particular use of mod_rewrite is within the TOS and AUP, you should ask first. With that said, you would add the following to your .htaccess file in your public_html directory: >RewriteEngine on RewriteBase / RewriteRule ^sunrise$ photos/east_coast/november/124.jpg This will do exactly what you want - a person browses to www.example.com/sunrise, the web server displays the file at www.example.com/photos/east_coast/november/124.jpg, and www.example.com/sunrise remains in the browser's address bar. Hope this helps... Quote
rnmcd Posted March 17, 2005 Author Posted March 17, 2005 Thank you very much David. That's all I'm trying to do...no funny business here. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.