![]() |
Problem removing 'index.php' with .htaccess - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Problem removing 'index.php' with .htaccess (/showthread.php?tid=8889) |
Problem removing 'index.php' with .htaccess - El Forum - 06-04-2008 [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... Problem removing 'index.php' with .htaccess - El Forum - 06-04-2008 [eluser]louis w[/eluser] Try placing this in the welcome controller. echo 'URI:'.$this->uri->uri_string(); And tell me what it says. Problem removing 'index.php' with .htaccess - El Forum - 06-04-2008 [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? Problem removing 'index.php' with .htaccess - El Forum - 06-04-2008 [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? Problem removing 'index.php' with .htaccess - El Forum - 06-04-2008 [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 Problem removing 'index.php' with .htaccess - El Forum - 06-04-2008 [eluser]louis w[/eluser] Try this out (removed the quotes) Code: RewriteEngine on Problem removing 'index.php' with .htaccess - El Forum - 06-04-2008 [eluser]shanecavaliere[/eluser] Still nothin ![]() Problem removing 'index.php' with .htaccess - El Forum - 06-04-2008 [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? Problem removing 'index.php' with .htaccess - El Forum - 06-04-2008 [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) Problem removing 'index.php' with .htaccess - El Forum - 06-04-2008 [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? |