Server/Apache

아파치에서 404 에러 띄우기

Dev. Tool 2023. 11. 28. 23:28
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]

 

출처 - https://stackoverflow.com/questions/5190206/how-do-i-redirect-a-url-that-isnt-found-without-sending-a-404-header