sandip
sandip

Reputation: 3289

Remove index.php from url not working

This is my .htaccess file:

     RewriteEngine On

     RewriteBase /mydomainname.com/
     RewriteCond $1 !^(index\.php|images|assets|robots\.txt) 
     RewriteRule ^(.*)$ /index.php/$1 [L]

This code is working on one hosting while not on the other. I tried by running this code on the both the hosting

1)on one hosting I have my code works without adding index.php in the url i.e

 www.mydomainname.com/contrlerName/functionname

2)On the other domain I need to add index.php in the url like :

 www.mydomainname.com/index.php/contrlerName/functionname

what can be the problem?

Thanks in advance!

Upvotes: 0

Views: 673

Answers (3)

newman
newman

Reputation: 2719

Just check what mod_rewrite work on your second hosting. Ask hosting support. There is like that hosting don't support rewrite.

Upvotes: 0

Venkat Kotra
Venkat Kotra

Reputation: 10743

AllowOverride All|None|directive-type [directive-type]

Ensure allow override directive enables .htaccess file in the second hosting where its not working.

http://httpd.apache.org/docs/2.2/mod/core.html#allowoverride

Upvotes: 1

barryhunter
barryhunter

Reputation: 21091

Remove teh RewriteBase line, That was probably required on your old one, but not no new. Thats non standard, it shouldn't really of been required. Probably they had some crazy virtual hosting setup.

It might also be your new hosting, doesnt allow .htaccess files, so it simply being ignored.

Upvotes: 1

Related Questions