0

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

2
  • Not able to understand your question, can you elaborate last sentence. Commented Nov 20, 2013 at 5:07
  • When I use my web browser to visit mydomain.com/magazine, its going to the actualy magazine directory instead of the magazine method within my site controller. Commented Nov 20, 2013 at 15:01

1 Answer 1

1

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

2 Comments

Yes I have what you suggested, though without the check for the directory. Do I need another RewriteCond specifically for magazine?
@MikeJouwstra YOu should't need any conditions for that because it is a directory, except you want it to be routed through index.php

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.