Jump to content

I need help creating pages!


AnSilva

Recommended Posts

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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 by logan
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...