• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Clean URL's

Hi Guys,

Sorry to start of with my first post being a question, but I hope you don't mind.

I'm having some trouble getting the clean URL's to work, I have tried a couple different '.htaccess' files, but none seem to get the job done, leading me to believe It's my fault.

Apache's mod_rewrite is enabled in the httpd configuration and I have set the index page config option to.

$config['index_page'] = '';

Here are the contents of the '.htaccess' file:
RewriteEngine On
RewriteBase /

RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php/$1 [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]

ErrorDocument 404 /index.php

This is placed in my document root (Outside of system, application etc...)

My httpd.conf file is set up (What is relevant) as such.

Quote:DocumentRoot "/Users/business/Sites"

<Directory />
Options FollowSymLinks
AllowOverride FileInfo
Order deny,allow
Deny from all

Any ideas would be greatly appreciated, oh and the error I get when trying to access a page without /index.php/whatever_page is a 404.


RewriteRule ^(.*)$ /index.php/$1 [L]

RewriteCond %{REQUEST_FILENAME} !-d

i just added the / in front of index.php

It was a very good idea (I had not spotted that). However sadly, it didn't solve the problem.

Thanks for the tip though Smile

I have also managed to gleam a little more info. It should be pointing any 404's to index.php, this is fine and should work. However my 404's are Apache generated, which suggests to me that the .htaccess isn't being used.

So, back to square one. Anyone got any other ideas?


Sorry for bumping guys, I don't know your rules on it Wink

A little more info, since I am on OSX I had edited the httpd.conf in /etc/apache2/httpd.conf. However I had forgotten that most user info is in /private, I've also edited /private/etc/apache2/httpd.conf.

Still no success, my system is going into beta today, so I really need to get this figured out.

Any help greatly appreciated.


Try AllowOverride All

If you are using CI 2+, then these lines are meaningless as the system folder now has its own htaccess protecting it (should verify)
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php/$1 [L]

If you are on OS X you may want to go to your web root folder in the terminal and check to see that the .htaccess file has the right permissions or in bazaar cases that it even exists and isn't instead represented as one of Apple's weird hidden files.

I ran into this just the other day. AllowOverrides was set to ALL, .htaccess file had no errors, but I still couldn't get Apache to use the .htaccess file. I was using Coda and it was showing the .htaccess file there, but when I went to the terminal to see if the permissions were OK, there was no .htaccess file at all.

It's a rare issue that I've only run into once before, but it's probably worth a look.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.