开发者

How can i redirect to my own page in wordpress?

开发者 https://www.devze.com 2023-03-12 22:02 出处:网络
In wordpress if pages are not found it automatically redi开发者_JAVA技巧rects to 404 page. but i want to redirect to default page which is i created in the same theme (without redirection to 404 page)

In wordpress if pages are not found it automatically redi开发者_JAVA技巧rects to 404 page. but i want to redirect to default page which is i created in the same theme (without redirection to 404 page) when the pages are not found. how can i do this?...

Thanks Ravichandran


ErrorDocument 404 /default.php

Add this in .htaccess file


you can edit the 404.php file, and then add the following line:

header('location:your-domain-name.com');

or you can redirect to some php file also:

header('location:default.php');

Simple trick. It works for me.

0

精彩评论

暂无评论...
验证码 换一张
取 消