• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
(CLOSED) - App is not working when placed in root folder

#1
[eluser]gryzzly[/eluser]
Hello,

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 :
Code:
store.domain.tld    points to     /www
essai.domain.tld    points to     /www/store/CodeIgniter

2) $config['base_url']
Code:
if($_SERVER['HTTP_HOST']=='store.domain.tld'){
    $config['base_url'] = "http://".$_SERVER['HTTP_HOST']."/store/CodeIgniter/";
}
elseif($_SERVER['HTTP_HOST']=='essai.domain.tld'){
    $config['base_url'] = "http://".$_SERVER['HTTP_HOST']."/";
}
else{
// ...
}



The A] website functions correctly. All urls load the right page :
Code:
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.
Code:
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 !
Emmanuel.

#2
[eluser]TheFuzzy0ne[/eluser]
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.

#3
[eluser]gryzzly[/eluser]
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]
</IfModule>

Thanks for help.

#4
[eluser]TheFuzzy0ne[/eluser]
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.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.