Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

My wordpress is telling me to update my htaccess file to:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

I'm using nginx, and I have this but it doesn't work:

 location / {
            root   /home/mywebsite/public;
            index  index.php index.html index.htm;

            if (!-e $request_filename) {
                        rewrite ~(.+)$ /index.php?q=$1 last;
            }
        }
share|improve this question
    
Wordpress will keep complaining about not having htaccess as it can't understand why anyone would not use Apache. If your site works then you should be good. –  Martin Fjordvald Nov 27 '10 at 12:59
add comment

1 Answer

try changing it to this;

   location / {
       root   /home/mywebsite/public;
       index index.php index.html index.htm;
       try_files $uri $uri/ /index.php;

   }

http://wiki.nginx.org/HttpCoreModule#try_files

share|improve this answer
    
That worked! Thanks for the info. –  Utkarsh Sinha Mar 3 '12 at 21:49
add comment

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.