问题原文
原帖链接 · sam · CC BY-SA 4.0
I've made a subsite which runs under example.com/subsite - ideally 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.
已采纳解答
原帖链接 · nathangiesbrecht · CC BY-SA 3.0
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 http://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.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
