Tag Info

Hot answers tagged

3

In nginx, you won't use a rewrite for this at all. You would use try_files instead. For example: try_files $uri $uri/ /puppy/index.php; Or, more likely, try_files along with a named location to handle PHP scripts. This isn't something that should be done in isolation; it is an integral part of the entire server block and you should not consider it ...


2

Unfortunately the only reasonable solution is to fix the application so that it generates correct URLs. All other solutions will cause subtle issues.


1

You should use another server block for the redirect. server { server_name *.domain.tld; listen 100.10.10.1; location /personal { rewrite ^ http://domain.tld/personal permanent; } } And then you should remove the location block from the other server block, and remove *.domain.tld from the server_name directive.


1

RewriteRule ^(cp_contactformtoemail_captcha.*image.jpg) /INDEX.PHP/$1


1

You may have better luck with this. server { listen 80 default_server; location / { rewrite ^/(.*)$ http://example.org/$1?site=$host permanent; } }



Only top voted, non community-wiki answers of a minimum length are eligible