Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

Hi i am using apache on mac, i have enabled php. I am trying to rewrite my url using .htacess.

http://localhost/~username/project/test  to http://localhost/~username/project/index.php?url=test
But received 404 error - on retrieving url - http://localhost/~username/project/test .

But - this - http://localhost/~username/project/index.php?url=test - Php is working fine.

My .htacess file contains these five lines:


RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^(.+)$ index.php?url=$1 [QSA,L]

I can see mod_rewrite in loaded modules in php info. How I can debug this to find out whether .htaccess is being called or not.

Path of my .htaccess file is - ~username/Sites/project/.htaccess.

share|improve this question

1 Answer 1

From Troubleshooting

Make sure that you don't have a AllowOverride None in effect for the file scope in question. A good test for this is to put garbage in your .htaccess file and reload the page. If a server error is not generated, then you almost certainly have AllowOverride None in effect.

Or the other way round, add some garbage to the htaccess, i.e.

Foobar

and reload the page. If you get some 500 server error message, htaccess (AllowOveride) is enabled.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.