0

I have directory structure on my production server as:

public_html/www                    # www.digicreek.com
public_html/educonnect             # educonnect.digicreek.com
public_html/educonnect/.htaccess   # Same as local(shown below)
public_html/.htaccess              # contains only one line (RewriteBase/)

Locally my htaccess looks like this:

RewriteEngine on
RewriteCond $1 !^(index\.php|resources|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]

Locally I can access: http://localhost/educonnect/profile

instead of : http://localhost/educonnect/index.php/profile.

But using same htaccess on my server;

I can not access: http://educonnect.digicreek.com/profile

However, this works: http://educonnect.digicreek.com/index.php/profile

What is wrong with the routing? Please help.

Do I need to make any changes to htaccess for working with subdomains?

aBhijit
  • 5,261
  • 10
  • 36
  • 56
  • Do you have another .htaccess file located inside of `educonnect` instead of under just `public_html`? Because you should – sjagr Dec 24 '13 at 04:12
  • Yes. I created one in educonnect with same content as shown in question. – aBhijit Dec 24 '13 at 04:13
  • I tried using same code on public_html/.htaccess and public_html/educonnect/.htaccess – aBhijit Dec 24 '13 at 04:18
  • And `http://www.digicreek.com` doesn't work either for URL rewriting, correct? – sjagr Dec 24 '13 at 04:19
  • I am using codeigniter only for educonnect.digicreek.com and not www.digicreek.com – aBhijit Dec 24 '13 at 04:22
  • Did you [try searching for other duplicates of the issue you're having?](http://stackoverflow.com/questions/15481035/removing-index-php-in-codeigniter-using-htaccess-file) That looks like a pretty good solution in case your `mod_rewrite` module is disabled. – sjagr Dec 24 '13 at 04:27
  • mod_rewrite is enabled. I tried plenty of SO solutions. – aBhijit Dec 24 '13 at 04:36
  • Try to change the last line with this (just getting rid of the QSA btw) : RewriteRule ^(.*) index.php/$1 [L] – tyegah123 Dec 24 '13 at 04:47

1 Answers1

1

Hi please try this in your htaccess

RewriteEngine on
RewriteCond $1 !^(index\.php|resources|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /public_html/index.php/$1 [L,QSA]
Avish Shah
  • 111
  • 7