由于具有相同名称的目录,未调用codeigniter控制器

I would like to avoid renaming directories or method names if at all possible, this was working on a previous server before being moved to a new hosting.

My directory structure is as follows:

  • /magazine
  • /site
  • /site/config
  • /site/config/routes.php (routes contains entry: $route["magazine"] = "site/magazine")
  • /site/controllers
  • /site/controllers/site.php (site controller contains method "magazine")
  • /site/models
  • /site/views
  • /.htaccess
  • /index.php

Everything about the site works perfectly until I browse to /magazine, and it tries to go to magazine directory, when I need it to goto the magazine method within the site controller.

Any help is greatly appreciated.

Thanks! Mike

In your htaccess file you probably have something like looks like:

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]

Try adding an additional rule for "magazine":

RewriteRule ^magazine/?$ index.php/magazine [L]