views:

38

answers:

3

Hi all, I have here a subdomain which i wish to pass on.

here the example of url : http://subdomain.domain.com/login
and it should point to : http://subdomain.domain.com/index.php/login

i write a simple htaccess

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond $1 !^(index\.php|images|robots\.txt|css|javascript)
RewriteRule ^(.*)$ index.php/$1 [L]

but i always get 500 server error. any body have idea where i wrong?

thanks for any help

A: 

Make sure Apache rewrite module is active and your .htaccess file has the following line before any rewrite rule:

RewriteEngine On
eyazici
i'm sorry, forget to say that i already have rewrite engine on. i will edit
Swing Magic
A: 

Assuming you have mod_rewrite enabled, your RewriteRule causes an infinite redirection loop, which exceeds the maximum number of redirects and causes an internal server error.

You need to condition your rule so it only rewrites once. For example, this should work:

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [L]
Tim Stone
A: 

It's normal, you go to http://subdomain.domain.com/login, get redirected to http://subdomain.domain.com/index.php/login, then to http://subdomain.domain.com/index.php/index.php/login and so on because you RewriteRule always match.

You can write `RewriteRule ^([^/]*)$ index.php/$1 [L]

radius
hi radius, i thanks for help, the error 500 is disappearbut i now get 404 page. i already try it in my local, and working great. but in server it come to 404 page.
Swing Magic
You probably have something wrong somewhere else
radius