SEO Friendly Urls

Francis Daly francis at
Sun Mar 4 13:13:48 UTC 2012

On Sun, Mar 04, 2012 at 12:47:49AM -0500, adam estes wrote:

Hi there,


If I've understood what you are trying to do, will

    location ^~ /fg152 {
        root /usr/local/domain;
        index index.php index.html;
        try_files $uri $uri/ /fg152/index.php;
        location = /fg152/index.php {
            include fastcgi.conf;
            fastcgi_pass unix:/etc/phpcgi/php-cgi.socket;

fit the requirements?

You can probably move "root", "index", and "include" to server level,
if they are common to other locations.

Be aware that this effectively *removes* the /.ht and /.svn protection
config for this location hierarchy, so you'll want to either put them
back in, or (better) not have readable files in the web space that you
don't want served.

And if you try to access /fg152a, you might be a bit surprised -- but
that can be adjusted later if necessary.

Francis Daly        francis at

More information about the nginx mailing list