Welcome Guest, Not a member yet? Register   Sign In
Rewriting with and without url_suffix
#1

[eluser]Isuka[/eluser]
Hello,

In my config.php file I enable the url_suffix option with .html so all my pages are .htmled.
In my .htaccess I removed the index.php like that
Code:
RewriteRule ^(.*).html$ index.php?/$1 [L]

If I go to mysite.com/about.html everything work fine, but if I go to mysite.com/about, I got a 404 Not Found, the default 404 page of Apache.

So I try to add another rule in my .htaccess, without the suffix
Code:
RewriteRule ^(.*)$ index.php?/$1
RewriteRule ^(.*).html$ index.php?/$1 [L]
Now if I go to mysite.com/about.html and mysite.com/about, both url gave me a 404 Not Found but the CI 404 page this time.

Maybe an .htaccess expert could tell me how can I do ?

Thanx Smile
#2

[eluser]Jelmer[/eluser]
I'm not entirely sure but the first rule is obiously going to match to .html pages as well as to non-html pages and send them in full to the controler. And it might go wrong if CI is not expecting .html suffixed urls?
#3

[eluser]Isuka[/eluser]
The weird thing is if I only have
Code:
RewriteRule ^(.*)$ index.php?/$1
in the .htaccess I go a CI 404 page too.




Theme © iAndrew 2016 - Forum software by © MyBB