News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Redirect to homepage if the page doesnt excist

Started by sikkens1997, May 06, 2011, 07:00:03 AM

Previous topic - Next topic

sikkens1997

Hello, I wanna know how to make a redirect link to another page, if my visitors go to a page that does not excist.

Example: I go to www.mydomain.com/birthday and this page does not excist. How will I make it so, that they get redirected to the link www.mydomain.com/pagenotfound

And so with all the pages that does not excist, that they get redirected to the link www.mydomain.com/pagenotfound


I know I must do this in .htacces but i don't know what to put in there.

gamesmad

Create a file called ".htaccess" in your root folder and paste "ErrorDocument 404 /404.html" into it.

This will redirect any missing pages to "404.html", or any other page you like.
1 on 1 SMF Help - Want 1 on 1 SMF Help? Post in Help Wanted or drop me a message!

Go Charter! - Please consider becoming a charter member to support SMF development.

Please do not PM me with general questions, posting in the appropriate board will ensure everyone benefits from the advice given.


gamesmad

1 on 1 SMF Help - Want 1 on 1 SMF Help? Post in Help Wanted or drop me a message!

Go Charter! - Please consider becoming a charter member to support SMF development.

Please do not PM me with general questions, posting in the appropriate board will ensure everyone benefits from the advice given.

sikkens1997

#4
Not solved. :(
I could not try this, since I didn't have the domain yet. Now I do.
When I go to FTP, and I put the file in there, it's there. When I reconnect or go to the site, It's not in there.

EDIT: It's because it's a secured file. I got in the File Manager and there it was.
Now I edited it like you said, excactly that but it doesn't work. :(

FINAL EDIT: It was because the page did not excist. It works totally fine now. Thanks <3

SOLVED

NanoSector

My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

Advertisement: