Welcome Guest, Not a member yet? Register   Sign In
1and1 not redirect htacces / route.php
#1
Exclamation 

Hello!
I'm using CodeIgniter for my website.

The pattern of CI to write the URL is:
e.g: http://mydomain.com/class/function/id
My case: http://mydomain.com/index.php/msg_controller/insert

But I want to use a customized routing as follows:
e.g: http: //mydomain.com/alias
My case: http://mydomain.com/contact

I wrote this:
./application/config/routes.php
PHP Code:
$route['contact'] = 'index.php/msg_controller/insert'


In my localhost, it works perfect. But 1and1 fails and can not find the page.
The service told me that the best use ".htaccess" file. But not works for me. I've tried a thousand methods.

mod_rewrite is active in my Apache. I've done some tests:
Code:
RewriteEngine On
RewriteRule test.html http://www.google.es [R]


My .htaccess file currently only has:
Code:
RewriteEngine On
RewriteBase /

Neither this works:
Code:
RewriteEngine On
RewriteBase /
RewriteRule  ^contact$ index.php/msg_controller/insert



I do not want only to hide 'index.php', I want to customize the url! 

Can you help me?
Thank you
Reply
#2

This works for me:
Code:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>
Reply




Theme © iAndrew 2016 - Forum software by © MyBB