Welcome Guest, Not a member yet? Register   Sign In
Removing Index.php on OSX Yosemite
#1

CodeIgniter newbie here.

I am trying to get the index.php file removed from the url. Here what I have done so far.

I have created an .htaccess file in the root at the same level as application and have this in the file
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php/$1 [L]

I have set $config['index_page'] = '';

I get a 404 not found error with this setup.

When I uncomment Include /private/etc/apache2/extra/httpd-vhosts.conf in the httpd.conf file I get 403 Forbidden.

I assume that the url after removing the index.cfm would be localhost/sites/xxxx/blog

Can anyone help.  I have scoured the internet trying various combinations of things and I am tired.  I assume this is a OSX thing.
Reply
#2

You might need this at the top of your htaccess
AllowOverride All

You might also need a ? after index.php here:
RewriteRule ^(.*)$ index.php?/$1 [L]
Reply
#3

(This post was last modified: 06-11-2015, 10:43 AM by skunkbad.)

(06-10-2015, 02:33 PM)CroNiX Wrote: You might need this at the top of your htaccess
AllowOverride All

You might also need a ? after index.php here:
RewriteRule ^(.*)$ index.php?/$1 [L]

Hey CroNix,

I'm pretty sure that AllowOverride can only be set in an apache conf file, because AllowOverride is what allows .htaccess to be used in the first place. While on linux and not mac, my AllowOverride is set up in each of my virtual host conf files. For instance:

Code:
<VirtualHost *:80>
        ServerName localhost.beck
        DocumentRoot /var/www/htdocs/beck
        <Directory "/var/www/htdocs/beck">
        RewriteEngine On
                AllowOverride All
    </Directory>
        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
Reply




Theme © iAndrew 2016 - Forum software by © MyBB