By sugarhill
Hi, this is my original Apache htaccess rule:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /
RewriteRule ^$ myapp/webroot/ [L]
RewriteRule (.*) myapp/webroot/$1 [L]
</IfModule>
I managed to get general rewrites working using this line in my nginx server block config:
location / {
root /var/www/example.com/html;
try_files $uri $uri/ /index.php$is_args$args;
}
However, resources located inside the folder “myapp/webroot/” fail to load on my website since they are now called at root level instead of the specified folder in apache.
What do I need to change to make the original folder rewrite rules work in nginx?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hm, after lots of trial & error it turned out that I just needed to adjust nginx root folder to apache rewrite folders. Now it works fine.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.