Dynadot

question Redirect all Traffic to Home Page

Spaceship Spaceship
Watch
I'm trying to figure out how to redirect all traffic to my hope page except traffic targetted to the various pages already existing on the website.

I have tried to use hostgator's redirect panel (redirect everything with a wildcard to homepage) but I always get a 'too many redirects' when later visiting the website.

Searching in Google I have found ways to edit .htaccess but since I have absolutely no idea what I'm doing I'm rather hesitant to follow those guides I find online.

Can anyone help? It's driving me crazy

thanks in advance
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
I do mine this way.....

I point the domain name servers to my webhost. Then in my domain cPanel I add the domain as an alias domain (not addon because that creates an extra folder) and that is it. Now whenever someone types in that domain name it will go to your main index file but show the domain the person punched into the address bar.

That is how all my domains land on www.mapledots.ca except the ones I put in as addons because they have unique webpages and I want them to be different.

Under your main domain you can then add a folder, lets call it listings and you can add an index file to it and then all your alias domains can also use alias/listings to look like a pro.

This way no .htaccess changes need to be made because it is all done automatically by cPanel.

I do use a number of .htaccess modifications but mostly for things like forcing https on specific urls and things like that.
 
1
•••
I'm embarrassed to say that I got only a part of all you said :)

I just visited your site and tried to access a non-existent directory (eg. mapledots.ca/asdasd/) I was immediately redirected to the home page. Did you achieve that by using that alias you mentioned? That's exactly what I want to do.

See, I have domains I often decide to remove from parking and just put a sale lander on them with maybe 1-3 pages in total.
How can I grab all the rest of the traffic pouring in and redirect it to the main page? Will that be possible using the Alias thing?

thanks again
 
0
•••
Sorry... see below
 
Last edited:
0
•••
<meta http-equiv="refresh" content="0;url=http://mapledots.ca">

Save it as 404.shtml and put it in your main directory

use a text editor and change to your url
 
Last edited:
1
•••
OK. For the past few minutes I've tried everything but that doesn't seem to work.

Note that the domain I tested it on is an addon domain so the main directory is the addon domain's main directory .

I tried both 404.shtml and 404.html ... nothing happens. I still get the error screen when I type a non-existent path.

Also note that there is no mention I can see in the htaccess on how to handle errors... could that be the reason?
This is how the htaccess looks like:

upload_2017-12-29_2-51-4.png


If that helps here is the domain I'm testing it on
 
Last edited:
0
•••
Yes in your case it is the addon domain directory

Open your text program and paste the code from my post below...

<meta http-equiv="refresh" content="0;url=http://mapledots.ca">

Change the url to what you want

now save the text file as the name " 404 "

when you upload the file to your directory change the name from

404.txt to 404.shtml (you will only see the ending extension once in ftp or if you set windows show it)

That is all that is required

NOTE THIS HAS NOTHING TO DO WITH THE .htaccess file

My deleted post was from my .htaccess file but in your case use what I posted now.
 
Last edited:
1
•••
That is exactly what I did in the first place following your directions in your earlier post.

Here is the addon domain's main directory:
upload_2017-12-29_3-49-37.png


and here is what it is contained in that 404 file:
upload_2017-12-29_3-50-33.png


Please let me know what you think I have done wrong. Thanks.
 
0
•••
Must be something in your .htaccess file interfering

Can you remove the file as a test and see if it fixes it?
 
0
•••
Well, I didn't remove the file, I just renamed it and it still doesn't work :/
 
0
•••
For arguments sake, have you tried a different browser?

It works for me, if I edit the URL it goes to the new address. I am giving you nothing different than what I am using.

Clear cache etc
 
0
•••
It works for you? I assume you mean you tested my site and works for you.

I always clear cache when I make changes just to be sure I get the right results.
I avoid checking on other browsers since I have all of them using scriptblockers etc. so the only browser left is Edge which gives me the same result as Chrome.

That's really strange.

I will keep playing with the 404 file in case there is something that eludes me.

Meanwhile, if anyone else can offer another suggestion, it'd be great to share it here :)
 
0
•••
no, so sorry about my lack of communication.

I meant to say if I edit my shtml file to a different address it makes the change right away.

I get this on your site
Picture0003.png
 
1
•••
When I remove my shtml file I get this
Picture0004.png
 
0
•••
So there is something configured wrong on your server

Looks completely different from mine
 
0
•••
That's the problem... configured wrong how? I haven't touched anything at all except to add that 404 file.

Also, you have probably noticed that everything works fine on the site except the redirections.... so frustrating
 
Last edited:
0
•••
See, without my shtml file it just says not found. Yours says 500 internal server error.

Try researching that

Sorry, but because I am not on your server I cannot diagnose that. Try your webhost help forum and get them a snapshot.
 
1
•••
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back