Adding a .html in the suffix does not do anything |
[eluser]gh0st[/eluser]
Hi there. I'm wanting to add a .html suffix in the URL. In the config, you can add a suffix, such as '.html', or whatever you like. However, if you go to; http://ci.localhost/helloworld And press enter, nothing is appended to the URL... Why is this, and how do you fix it?
[eluser]Jelmer[/eluser]
Links generated by CI functions like anchor() should include it. Adding the suffix doesn't make CI auto add it to your URLs while accessing them, only through functions. In my case the requests are accepted only if the include the .html suffix because of my .htaccess: Code: Options +FollowSymLinks And all others throw an error with CI because of these instructions: Code: ErrorDocument 404 /error/404.html
[eluser]gh0st[/eluser]
Oh Okay. I'll look into this more. Ideally I'd love to have it automatically appending, regardless of whether you put the extension or not.
[eluser]John_Betong[/eluser]
[quote author="Jelmer" date="1233949446"] Links generated by CI functions like anchor() should include it. Adding the suffix doesn't make CI auto add it to your URLs while accessing them, only through functions. In my case the requests are accepted only if the include the .html suffix because of my .htaccess: Code: Options +FollowSymLinks I am in the process of trying to change an existing site using the config.php URL suffix ".html" Most of the site is now working but a new hurdle has arisen because of REMOTE URLs without any extension. (The old site had no index.php, etc) I have tried without success in re-routing these URLs but they fall over in the .htaccess file and never even reach the hidden index.php. I use the following .htaccess code: Code: RewriteRule ^(.*).html$ /index.php?/$1 [/code] I have unsuccessfully searched for a .htaccess solution and would be gratefult if anyone can supply the .htaccess code to append .html to the offending REMOTE URLs |
Welcome Guest, Not a member yet? Register Sign In |