Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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]

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

try changing it to this;

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


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

Its works Perfectly.

And for Enable PHP

pass the PHP scripts to FastCGI server listening on

    location ~ \.php$ {
            fastcgi_split_path_info ^(.+\.php)(/.+)$;
    #       # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
    #       # With php5-cgi alone:
    #       fastcgi_pass;
    #       # With php5-fpm:
            fastcgi_pass unix:/var/run/php5-fpm.sock;
            fastcgi_index index.php;
            include fastcgi_params;
share|improve this answer
Can you add some explanation about this magic? – Pierre.Vriens Apr 18 at 10:08

Your Answer


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.