Jump to content

How To Have Two Url That Take You To The Same Page


rnmcd

Recommended Posts

(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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

You are correct.  It adds redirect statements to the .htaccess file.

 

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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...

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...