This is my .htaccess
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)/?$ index.php?url=$1 [NC,L]
ErrorDocument 100 http://localhost/user/error
ErrorDocument 101 http://localhost/user/error
ErrorDocument 200 http://localhost/user/error
ErrorDocument 201 http://localhost/user/error
ErrorDocument 202 http://localhost/user/error
ErrorDocument 203 http://localhost/user/error
ErrorDocument 204 http://localhost/user/error
ErrorDocument 205 http://localhost/user/error
ErrorDocument 206 http://localhost/user/error
ErrorDocument 300 http://localhost/user/error
ErrorDocument 301 http://localhost/user/error
ErrorDocument 302 http://localhost/user/error
ErrorDocument 303 http://localhost/user/error
ErrorDocument 304 http://localhost/user/error
ErrorDocument 305 http://localhost/user/error
ErrorDocument 307 http://localhost/user/error
ErrorDocument 400 http://localhost/user/error
ErrorDocument 401 http://localhost/user/error
ErrorDocument 402 http://localhost/user/error
ErrorDocument 403 http://localhost/user/error
ErrorDocument 404 http://localhost/user/error
ErrorDocument 405 http://localhost/user/error
ErrorDocument 406 http://localhost/user/error
ErrorDocument 407 http://localhost/user/error
ErrorDocument 408 http://localhost/user/error
ErrorDocument 409 http://localhost/user/error
ErrorDocument 410 http://localhost/user/error
ErrorDocument 411 http://localhost/user/error
ErrorDocument 412 http://localhost/user/error
ErrorDocument 413 http://localhost/user/error
ErrorDocument 414 http://localhost/user/error
ErrorDocument 415 http://localhost/user/error
ErrorDocument 416 http://localhost/user/error
ErrorDocument 417 http://localhost/user/error
ErrorDocument 500 http://localhost/user/error
ErrorDocument 501 http://localhost/user/error
ErrorDocument 502 http://localhost/user/error
ErrorDocument 503 http://localhost/user/error
ErrorDocument 504 http://localhost/user/error
ErrorDocument 505 http://localhost/user/error
if I enter: http://localhost/usuarios/
everything is perfect, but when I enter http://localhost/usuarios
shows me the error page because I remove the /
When I remove the absolute path leaving ErrorDocument 404 /error
i do not fault in any way, the problem is that i do not recognize the file error.tpl error without absolute path because this index is called to another folder.
Questions:
- Is there any way to save write 40 times
ErrorDocument xxx http://localhost/user/error
. - I want to avoid getting and modify the route when climbing the project to the real server. That's why I would like to NOT use the full path.