Welcome Guest, Not a member yet? Register   Sign In
htaccess, routes, database, multilanguage, errordocument, is it possible to do so?
#1

[eluser]Unknown[/eluser]
The situation:
i have database with table pages.
i want to get such url:

/en/producs/coffee/
/en/products/tea/
/es/prudocte/tai-niekoi/
/es/product/nieko/cia-nera (without trailing slash)

want to use only one controller to handle these url. There i would check what page to display.

But in htaccess i want to specify error documents like this:
ErrorDocument 400 /400.html
ErrorDocument 403 /403.html
ErrorDocument 404 /404.html
ErrorDocument 500 /500.html

because i prefer to use static error templates.

Also should work controllers calls like this:
/index.php?c=controller1&method=method1 OR
/index.php/?c=controller1&method=method1 OR something like that.

what i tryed:
this htaccess

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ index.php/$1 [L,QSA]

ErrorDocument 404 /404.html
</IfModule>

and

this routing
$route['default_controller'] = "welcome";
$route['404_override'] = '';
$route[':any'] = 'content';


the problem is of this RewriteRule ^(.*)/$, when url doesnt end with / it also redirects to error page.
And such url
/?c=controller1&method=method1 OR
/index.php?c=controller1&method=method1

doesnt work too.

Anybody knows how correct to do all these things?
#2

[eluser]Unknown[/eluser]
no one?




Theme © iAndrew 2016 - Forum software by © MyBB