Welcome Guest, Not a member yet? Register   Sign In
(CLOSED) - App is not working when placed in root folder


I have a strange problem that i do not arrive to debug. Let me show you : [links edited]

A] http://store.domain.tld/store/CodeIgniter
B] http://essai.domain.tld

Both A and B represent the same website, they are on the same distant host.

The only differences are

1) subdomains :
store.domain.tld    points to     /www
essai.domain.tld    points to     /www/store/CodeIgniter

2) $config['base_url']
    $config['base_url'] = "http://".$_SERVER['HTTP_HOST']."/store/CodeIgniter/";
    $config['base_url'] = "http://".$_SERVER['HTTP_HOST']."/";
// ...

The A] website functions correctly. All urls load the right page :
http://store.domain.tld/store/CodeIgniter/                 =>    points to the home
http://store.domain.tld/store/CodeIgniter/contact          =>    points to the contact page
http://store.domain.tld/store/CodeIgniter/legal-mentions   =>    points to the legals
etc, etc...

The B] website does NOT function. The only url that load the right page is the home.
http://essai.domain.tld/                =>    points to the home : OK
http://essai.domain.tld/contact         =>    points to the home : BAD
http://essai.domain.tld/legal-mentions  =>    points to the home : BAD
etc, etc...

Locally, the website functions perfectly, both from subfolders or from root folder :
- http://localhost/store/CodeIgniter/
- http://store.dev/ (that points on /store/CodeIgniter )

What can be the thing ?
I'm completly lost and do not know where to search.

Thank's for reading, and for future answers !

It could be your htaccess file, or your URI protocol. I'd suggest trying either QUERY_STRING or REQUEST_URI as your URI protocol in the config.php.

Ok, it was a .htaccess problem.

I missed the "?" char in the rewrite rule :

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]

Thanks for help.

That's one way to do it, although I suspect that changing the URI protocol might have also done the same thing. If you do try removing the ? and changing the URI protocol, I'd be interested to know if it did work. I'm wondering if the two solutions are related.

Theme © iAndrew 2016 - Forum software by © MyBB