apache - How to redirect a 404 error to the homepage using a link and not a path -


i want website redirect homepage when error 404. using this:

errordocument 404 /index.php 

it works when error in root, eg when type www.example.com/skdsjdksjdjksdsdsd

but when error under path (not in root) eg type www.example.com/sdasd/sdsdsdsdsdsag

it tries redirect unstyled page no javascript loaded.

is possible replace index.php website url?

i trying redirect error full url page code below doesn't work:

errordocument 404 /https://www.mywebsite.com #doesn't work   errordocument 404 /www.mywebsite.com #doesn't work 

you might want use custom error page. if so, found article helped me out on website. here link: custom-error-page article


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -