AnSilva Posted June 19, 2022 Share Posted June 19, 2022 Hi! I need help creating pages. I'm used to WordPress, where everything happens automatically, but here I don't understand. I need to create pages and set up their URLs. I was able to create pages, but when creating them they became accessible only through the URL: https://domain/test_page.php Why does it happen? After searching a lot I think it is necessary to create a rule so that the URL "https://domain/test_page/" displays the contents of the file "https://domain/test_page.php" Okay, so far I understand. My server is NGINX. The problem is that when set up the “rewrite” rules as follows: rewrite ^/test_page/$ /test_page.php last; The page only opens if we type the address with the last slash, that is: "https://domain/test_page/" but if I type without the last slash, like this: "https://domain/test_page", it shows error 404, the page is not redirected. Is this really the page creation process? Do I always need to change these rules in NGINX? How can I simplify adding pages? Also, after installing KVS on my NGINX server, all pages only work if I type the last slash in the URL: "/test_page/". If I type without the last slash, ie "/test_page", it shows a 404 error. Is that right??? In all pages? Quote Link to comment Share on other sites More sharing options...
Tech Support Posted June 19, 2022 Share Posted June 19, 2022 Are you sure your server doesn't have Apache? We don't actually provide support for Nginx, because this is not easy and convenient - you have to modify Nginx config with the root user and then login to server panel to restart Nginx. This is better from performance view, but bad from usability and support. So we do not provide any support for this. But if your project has Apache, you don't need to do this. You can simply add this rule into the primary .htaccess file (in the www root directory): RewriteRule ^test_page/$ test_page.php [L,QSA] As a bonus to that, you don't have to care about slash at the end, because by default this is already considered and your .htaccess file contains global redirect for all non-slash URLs. Quote Link to comment Share on other sites More sharing options...
AnSilva Posted June 19, 2022 Author Share Posted June 19, 2022 1 hour ago, Tech Support said: Are you sure your server doesn't have Apache? We don't actually provide support for Nginx, because this is not easy and convenient - you have to modify Nginx config with the root user and then login to server panel to restart Nginx. This is better from performance view, but bad from usability and support. So we do not provide any support for this. But if your project has Apache, you don't need to do this. You can simply add this rule into the primary .htaccess file (in the www root directory): RewriteRule ^test_page/$ test_page.php [L,QSA] As a bonus to that, you don't have to care about slash at the end, because by default this is already considered and your .htaccess file contains global redirect for all non-slash URLs. Hi! Thanks for your support! My server is NGINX and all rules have been converted to NGINX and the site works perfectly fine on NGINX. I managed to find the equivalent rule in NGINX, so now I don't have to worry about the slash at the end like you said. Thanks for the help, but I already found the solution. Quote Link to comment Share on other sites More sharing options...
logan Posted June 21, 2022 Share Posted June 21, 2022 (edited) Thanks for your support! My server is NGINX and all rules have been converted to NGINX and the site works perfectly fine on NGINX. I managed to find the equivalent rule in NGINX, so now I don't have to worry about the slash at the end like you said. Thanks for the help, but I already found the solution. Can you share your NGINX configuration and pseudo-static rules? Edited June 21, 2022 by logan 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.