Redirect without the URL changing

Category: Domain Names

stepsimon
Asked:
2013-08-26 11:40 am EST

Hits: 4,475
My page stephensimon.net/theblacklemons.html
redirects to theblacklemons.com. How do I keep the url from changing from theblacklemons.com, to stephensimon.net/theblacklemons.html, when the page is visted.

Thanks

You must login before you can ask a follow up question.

You must login before you can submit an answer.

OTHER ANSWERS

0

JacobIMH
Staff
9,968 Points
2013-08-26 1:21 pm EST
Hello stepsimon, and thanks for the question.

It looks like you might have changed some things since posting this question. I do see a (theblacklemons.htm) page. However this doesn't appear to have a redirection code in it such as a HTML meta refresh to re-direct to a different site which would change the URL.

You can use a .htaccess 301 redirect to redirect pages as well.

However in your case it would help with a bit of clarity on what your end goal is. As if you wanted the URL to remain in the address bar as:


stephensimon.net/theblacklemons.html


Then technically, you'd just create the content you want displayed into that theblacklemons.html page, upload it to your stephensimon.net site, and then don't do any sort of redirection.

You can force the address bar to stay the same and not change by removing the [R=301] flag in your .htaccess rule, and also not using a full domain name. But that will only work on the same domain. As it's a security problem if you were able to type in one domain name but getting served content from another.

For instance, if you had the page secret.htm, and wanted it to be accessed in the address bar as:


theblacklemons.com/public.htm


You could use the following .htaccess code:


RewriteEngine On
RewriteRule ^public.htm$ /secret.htm [L]


I hope that was clear enough for the problem you're trying to solve, if you had any further questions at all please let us know.

- Jacob


You must login before you can post a comment about this answer.

Hi Jacob,
Thanks for taking a look at this. Sorry I was not clear. The actual page with the redirect is: stephensimon.net/lemons.html

theblacklemons.com, redirects to: stephensimon.net/lemons.html

So, you put theblacklemons.com in the url, you are taken to stephensimonsimon.net/lemons and now the address in the url box changes to stephensimon.net/lemons.

I would like visitors to enter theblacklemons.com in the url, and have that address remain theblacklemons.com in the url address bar, NOT change to stephensimon.net/lemons

Thanks again. Any help would be appreciated.

stepsimon
14 Points
2013-08-27 10:24 am EST
Hello stepsimon,

Thank you for your comment. It seems you are just trying to host another website, and have it load from a specific folder. You can accomplish this by Adding the domain to your cPanel, then for the document root enter:
public_html/theblacklemons.com

Be sure to allow up to 24 hours for the Addon domain to propagate.

Then delete the existing redirect, and the site will load successfully on the address:
theblacklemons.com

If you have any further questions, feel free to post them below.
Thank you,

-John-Paul
johnpaulb-imhs1
9,684 Points
Staff
2013-08-27 11:00 am EST
Hey there,
So, for document root enter: public_html/theblacklemons.com, get's me a folder in the public_html folder of stephensimon.net called theblacklemons.com. In that folder I have set up an index.html page. Is this the correct way to set up the index page for an add on domain?

Also, I removed the redirect two days ago. Right now when I enter theblacklemons.com in the url, I get a 404, but the url still shows the redirect as active. The 404 is because I have deleted the page that the redirect originally pointed to.

Any help would be appreciated.

Thanks
stepsimon
14 Points
2013-08-30 11:19 am EST
Hello stepsimon,

Try to clear your web-brower's cache, as it sounds like you probably cached the .htaccess rules. Placing a index.html file in the document root of your addon domain should force that site to use that as its index page.

Currently I'm not seeing a 404 error when just accessing your addon domain. I also don't see any RewriteRule statements in your .htaccess file that should be trying to cause a re-direction.

Please let us know if you're still seeing any issues after clearing your cache.

- Jacob
JacobIMH
9,968 Points
Staff
2013-08-30 12:14 pm EST
Worked! Thanks for the help!! Have a great weekend!!!!
stepsimon
14 Points
2013-08-30 1:11 pm EST
Hello stepsimon,

Awesome! Glad to hear that worked :)

- Jacob
JacobIMH
9,968 Points
Staff
2013-08-30 1:18 pm EST
Like this Question?

Related Articles

It looks like there are no related articles.
Would you like to ask a question about this page? If so, click the button below!
Ask a Question

Need more Help?

Search

Ask the Community!

Get help with your questions from our community of like-minded hosting users and InMotion Hosting Staff.

Current Customers

Chat: Click to Chat Now E-mail: support@InMotionHosting.com
Call: 888-321-HOST (4678) Ticket: Submit a Support Ticket

Not a Customer?

Get web hosting from a company that is here to help. Sign up today!