简体   繁体   中英

error 500 when i create on htaccess one error 404

How can i make it so that my htacces rules return a 404 when invalid urls are entered into the adress bar.

I use the virtualbox for one project and i try create one file .htaccess and i put one error 404 to protect my pages, but when i create my error 404 and sending to the server and refresh my page i have one error 500 on my server.

My code is this:

#my error 404 
ErrorDocument 404/file/404.php

Anyone can help me? I don't know why this happens and I have searched on google.

Greets

您必须用引号将路径包裹起来,以确定它是否为字符串

ErrorDocument "404/file/404.php"

A Little White Space causes the issue

Change this

ErrorDocument 404/file/404.php

to

ErrorDocument 404 /file/404.php

Read more here

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM