Tag Info

Hot answers tagged


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 ...


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


You should use another server block for the redirect. server { server_name *.domain.tld; listen; 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.


RewriteRule ^(cp_contactformtoemail_captcha.*image.jpg) /INDEX.PHP/$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