Problem removing 'index.php' with .htaccess |
[eluser]shanecavaliere[/eluser]
I did try yours, it gave me the same result as the others, which is just showing me the CI 'Welcome' page. The blog controller has an index method. (It works fine when I go to http://example.com/index.php/blog/) As for the rewrite log, I'm on shared hosting, so I don't think I have the ability to add that...
[eluser]louis w[/eluser]
Try placing this in the welcome controller. echo 'URI:'.$this->uri->uri_string(); And tell me what it says.
[eluser]shanecavaliere[/eluser]
It just says "URI:" and then nothing after. I also added that to the blog controller, and went to http://example.com/index.php/blog/, and then it said "URI: /blog/". ...Does that tell you anything?
[eluser]louis w[/eluser]
Ahh ha! Yes. That means that the $1 var is not getting applied to the url when being rewritten. What kind of system is this running under, and what is your host? Have you ever done ModRewrite on it before?
[eluser]shanecavaliere[/eluser]
Apache 2.2.8 (Unix), hosted by Eleven2.com. Under this same host, I have successfully used other mod_rewrites before. For example, in the directory /test/babs/ I have an .htaccess file that says Code: # this is the initialization
[eluser]louis w[/eluser]
Try this out (removed the quotes) Code: RewriteEngine on
[eluser]louis w[/eluser]
Hmm...... strange. Why are you using RewriteBase /test/babs in the other one? Are the files not at the http root?
[eluser]shanecavaliere[/eluser]
Yeah, that .htaccess file, as well as the respective index.php file are both in the /test/babs directory. For this problem, both the CodeIgniter index.php file and the .htaccess file are in the site's root. Also, I'm not sure if this helps, but when I change the .htaccess file to: Code: # this is the initialization It sort of works... When I go to 'example.com/blog/' it shows me what I would like, but when I go to 'example.com/blog/index/' it gives me a 404 error. (edit: sorry, I hit submit before I was ready)
[eluser]louis w[/eluser]
[quote author="shanecavaliere" date="1212628901"]Also, I'm not sure if this helps, but when I change the .htaccess file to: [/quote] What happens? |
Welcome Guest, Not a member yet? Register Sign In |