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?

8
  • Do you have another .htaccess file located inside of educonnect instead of under just public_html? Because you should Commented Dec 24, 2013 at 4:12
  • Yes. I created one in educonnect with same content as shown in question. Commented Dec 24, 2013 at 4:13
  • I tried using same code on public_html/.htaccess and public_html/educonnect/.htaccess Commented Dec 24, 2013 at 4:18
  • And http://www.digicreek.com doesn't work either for URL rewriting, correct? Commented Dec 24, 2013 at 4:19
  • I am using codeigniter only for educonnect.digicreek.com and not www.digicreek.com Commented Dec 24, 2013 at 4:22

1 Answer 1

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]
Sign up to request clarification or add additional context in comments.

1 Comment

Hi, In mycase I had AllowOverride None in my subdomain conf file, i changed it to AllowOverride All :D

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.