Mobile app version of vmapp.org
Login or Join
Shelley277

: Separate 404 page for subdirectory I've made a subsite which runs under mydomain.com/subsite - idealy from an architecture point of view it would be under a subdomain, but we wanted the links

@Shelley277

Posted in: #Htaccess

I've made a subsite which runs under mydomain.com/subsite - idealy from an architecture point of view it would be under a subdomain, but we wanted the links to come back to the main domain.

The sub site has a completely different design, and layout, and has a 404 page that is in keeping with the rest of it.

How can i set the 404 for the /subsite subdirectory, without affecting the root domains 404 settings in the .htaccess file.

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Shelley277

1 Comments

Sorted by latest first Latest Oldest Best

 

@Tiffany637

Very simple. Just create another .htaccess file in the /subsite directory, and set your ErrorDocument 404 in it to the subsite's 404 page, ie ErrorDocument 404 example.com/subfolder/alternate-404.html. The .htaccess in the parent folder will still be used for the main document root, and all other subfolders.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme