1

I just bought a Mac-pro with Mavericks 10.9.1 and before that I was working on pc with Windows 7.

I created a project under the windows 7 OS and now I want to import it to OSX, the import was successful apart from the .htaccess file. I can't remove index.php from my urls. I have MAMP installed and my urls only work if I use index.php:

  • don't work : (localhost/~username/feel/products)
  • work : (localhost/~username/feel/index.php/products)

I tried all the options of RewriteEngine, RewriteCond and RewriteRule in .htaccess file. I give all the folders/files chmod 755, have put $config['base_url']='' and $config['index_page'] = ''; with and without root or index.php page.

The file .htaccess is in the same folder of the index.php page, the AllowOverride None is AllowOverride All.

2 Answers 2

2

I think the problem is related to the way OS X handles different users for apache. I used the .htaccess file as described in the CodeIgniter URL documentation and added a line using RewriteBase.

RewriteEngine on
RewriteBase /~username/path/to/CI/
RewriteCond $1 !^(index\.php|static|robots\.txt)
RewriteRule ^(.*)$ index.php/$1 [L]

By the way, I'm using OS X 10.9.3 (Mavericks) and CodeIgniter 2.2.0

Sign up to request clarification or add additional context in comments.

1 Comment

This did it for me! Also modified httpd.conf as per @stomdrain. Thank you!
0

You have to set AllowOverride All in the Directory:

/private/etc/apache2/httpd.conf

182 <Directory />
183     Options +FollowSymLinks
184     AllowOverride All
185     Order deny,allow
186     Deny from all
187 </Directory>

then restart Apache

sudo apachectl restart

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.