Show 404 Page When User Types index.php within URL |
[eluser]fjamal[/eluser]
I need to show 404 page when user types index.php within the URL as: Quote:http://localhost:8080/site_name/index.php/homeI add this in routes.php Code: $route['index.php/(:any)'] = 'custom404'; It didn't help. I have the htaccess that allows me to remove index.php from url, but i also want to show 404 page in case user types index.php in URL manaully. Any suggestions? My htaccess: Code: RewriteEngine On
[eluser]fjamal[/eluser]
[quote author="Aken" date="1344672560"]I'd suggest not doing it in the first place. [/quote] May i know why you don't recommend it?
[eluser]fjamal[/eluser]
I might just use redirect via htaccess; the right solution.
[eluser]Aken[/eluser]
If you ever need to disable your .htaccess rewrite that removes index.php, you'll need index.php to work so you can actually see your website still. A redirect is an option, but if you don't link people to index.php in the first place, they'll never know the URL exists, unless they randomly punch it into their browser. |
Welcome Guest, Not a member yet? Register Sign In |