Am new in Codeigniter i want to block assets
folder in my website. I mean website users(website viewer)
enter http://www.example.com/assets
it move to 404
page.
Please help me...!
Thanks in advance
If your assets folder is there to serve things like CSS, JavaScript and image files (like would be intended), and is an actual directory, then you can either do this by adding a .htaccess file to the directory (assuming it's running under Apache) which will take all requests which are not for explicit file paths and route them to the website controller/action for a 404 (or other page you use for this).
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ http://yourdomain.com/path/to/404 [QSA,L]
</IfModule>
Alternatively, you can add an index.php
file which redirects the browser to the location for a 404 page, or displays a 404 type page as a response.
header("Location: http://yourdomain.com/path/to/404");