CodeIgniter Forums
Help With Routing - Printable Version

+- CodeIgniter Forums (
+-- Forum: Archived Discussions (
+--- Forum: Archived Development & Programming (
+--- Thread: Help With Routing (/thread-54470.html)

Help With Routing - El Forum - 09-10-2012

I agreed to help a friend with a site based on CodeIgniter. I've done a lot of php coding with WordPress, Joomla, and others. I can't see to get headed in the right direction. If someone could point me in the right direction I would appreciate it.

I have copied the original files from the server to an Ubuntu VM. The home page comes up fine, but all of the menu items point to /Home/SomePage, etc. Home is the controller, but the web server is looking for SomePage in the Home folder, which doesn't exist.

What am I missing?


Help With Routing - El Forum - 09-10-2012

Falsely configured .htaccess? Regarding RewriteBase and mod_rewrite in your apache2/lampp config

Permission problems?

Help With Routing - El Forum - 09-10-2012

Thanks for the information it was very helpful. I have edited the .htaccess file in the root (DocumentRoot = "/var/www/html") to have one simple rule.

RewriteEngine On
RewriteOptions Inherit
RewriteBase /
RewriteRule ^alice.html$ test.php

Test.php contains <? phpinfo(); ?>. That page shows that mod_rewrite is loaded. When I use http://localhost/alice.html, it does not redirect to test.php, which I would expect.

Also having an amazingly difficult time setting the log level. Trying to set the level per module (i.e. LogLevel rewrite:debug) generates an error when restarting Apache. The maximum detail comes from "LogLevel debug". Trying any of the trace levels also generates an error.

It acts like the .htaccess file is being ignored.

Help With Routing - El Forum - 09-10-2012

A period is a special symbol in regex - you have to escape it for it to act like a period.

I would verify that everything works properly without .htaccess first. I don't really understand exactly what your problem is anyway (are you getting 404 pages? is there a "SomePage" in the link that shouldn't be there?)

Help With Routing - El Forum - 09-11-2012

Yes I am getting a 404.

I made sure the period was escaped in the .htaccess file. I get the same result. Requests for alice.html are not being redirected to test.php. Test.php does work. That's how I see that mod_rewrite is beling loaded.

Help With Routing - El Forum - 09-11-2012

Found it!!!

The main conf file (default) had "AllowOverride None" defined for the root folder. I was working in httpd.conf which also had settings for the root folder. Once I set AllowOverride to All in the default config, it began working.

Thanks for all your help. You pointed me in the right direction. Just what I needed.