kong Posted March 23 Share Posted March 23 I would like to inquire about an issue with Nginx server. I have configured multilingual URLs in the background, where accessing www.domain.com automatically redirects to www.domain.com/de, but it shows a '404 NOT FOUND' error. How can I solve this? When I raised a support ticket, the administrator replied that they only handle .htaccess files, and they do not configure Nginx. Could any kind-hearted technical experts please help me? Thank you. Quote Link to comment Share on other sites More sharing options...
Tech Support Posted March 24 Share Posted March 24 To add to this question, these are the .htaccess mod_rewrite rules that do the magic for allowing subfolders being used: RewriteCond %{ENV:REDIRECT_REWRITTEN} !=1 RewriteCond %{ENV:REDIRECT_REDIRECT_REWRITTEN} !=1 RewriteRule ^([a-z]{2})/(.*) /$2 [L,QSA,E=REWRITTEN:1,E=LOCALE:$1] They translate https://domain.com/de/someurl/ into https://domain.com/someurl/ and add ENV variable REDIRECT_LOCALE = de Quote Link to comment Share on other sites More sharing options...
kong Posted March 29 Author Share Posted March 29 After struggling for half a month, I still couldn't resolve it. Even asking CHATGPT for help with writing code didn't work. There was no other choice but to switch to .htaccess, uninstall Nginx, install Apache. Now the website can be accessed normally. I really don't know why I've been tinkering with it for so long... Quote Link to comment Share on other sites More sharing options...
Tech Support Posted March 30 Share Posted March 30 You don't need to uninstall Nginx, Nginx should be normally used as a proxy on top of Apache for static files (JPG, JS, CSS and video files). Also you can use subdomains for localized versions instead of subfolders. This doesn't require any .htaccess specific rules. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.