Ravichandran Jothi
Ravichandran Jothi

Reputation: 3066

How can i redirect to my own page in wordpress?

In wordpress if pages are not found it automatically redirects 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

Upvotes: 0

Views: 308

Answers (2)

Sujit Agarwal
Sujit Agarwal

Reputation: 12508

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.

Upvotes: 0

Vamsi Krishna B
Vamsi Krishna B

Reputation: 11490

ErrorDocument 404 /default.php

Add this in .htaccess file

Upvotes: 1

Related Questions