1

Here is my htaccess file and it works somewhat. Not matter what controller I specify it always goes to the home page

<IfModule mod_rewrite.c>
RewriteEngine On

#Checks to see if the user is attempting to access a valid file,
#such as an image or css document, if this isn't true it sends the
#request to index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
#This last condition enables access to the images and css folders, and the robots.txt file
RewriteCond $1 !^(index\.php|css|js)
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>

This is my website URL

http://automationmetrics.local/automation/

Thoughts?

2 Answers 2

3

Some things I usually check when this happens to me:

  • Have I enabled the mod_rewrite module in Apache?
  • Have I set $config['index_page'] to blank?

If the above works, here's the one that I use, that's working on my end:

https://gist.github.com/petrepatrasc/6925413

If you're STILL out of luck, then try fiddling with the $config['uri_protocol'] parameter - I remember that I could only get it to work on Windows (with IIS at the time) using REQUEST_URI as a value. Might be related to that.

Sign up to request clarification or add additional context in comments.

Comments

1

The first two rules get triggered on all the files, just like it says in the comment. So this one:

RewriteCond $1 !^(index\.php|css|js)

seems redundant and removing it should solve the issue you're having.

2 Comments

This should probably be a comment rather than an answer, since it's a long shot - as numerous problems can occur and create the issue OP is having... but from what is given in the question, this could go as an answer.
Removing that line fixed the problem.

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.