Ravi Dhoriya ツ
Ravi Dhoriya ツ

Reputation: 4414

Disable codeigniter error page for specific directory

my CodeIgniter project is located at www.mydomain.com/project

For that Custom 404 error page is working fine, that I've configured by writing following line in routes.php

$route ['404_override'] = 'content/not_found/'; //Here, content is controller, not_found() is method to handle 404 error.

I've one sub directory under my codeigniter project named sub_project, i.e www.mydomain.com/project/sub_project

I want to use custom_404.html for my sub_project (which is not coded in CodeIgniter framework). For that I found an example of .htaccess to set 404 error page.

I created File: /project/sub_project/.htaccess

ErrorDocument 404 /project/sub_project/custom_404.html

Now, What happends for my sub_project is, Its showing me www.mydomain.com/content/not_found/ error page instead custom_404.html

Directory structure:

 www.mydomain.com
                |--/project                             (CodeIgniter)
                |--/project/applications/routes.php     (routes.php location)
                |--/project/sub_project                 (Other project in core PHP)
                |--/project/sub_project/.htaccess       (.htaccess location)
                |--/project/sub_project/custom_404.html (New error page)

Upvotes: 0

Views: 502

Answers (1)

sunny
sunny

Reputation: 1166

try

RewriteEngine on 
ErrorDocument 404 /project/sub_project/custom_404.html

Upvotes: 1

Related Questions