HR
Asked
Good evening friends, how can I make the pages open at the root without including the page/
Example: https://mydomain/privacy-policy
Kind regards.
Example: https://mydomain/privacy-policy
Kind regards.
- MSAnsweredHello,
There is no option unless you add new routes in the `app/config/routes.php` file for `/privacy-policy` to load `/page/privacy-policy`
Thank you - HRAnsweredHello Mian, thanks for your answer, but that option is valid in the case of static pages, but not in dynamic pages, that is, I cannot guess which are the "slug", there must be some way to push those pages to root, with this
$ route ['(: any)'] = 'shop / shop / page / $ 1';
It works but any name you put in the URL will open a blank page and never redirect to the 404 error page.
Kind regards. - MSAnsweredYes, there are limitations. I don't know any way to dynamically move the routes as you need. Thank you
- HRAnsweredHell Mian, how are you.
A query because manually entering any name in the "page/" URL results in a blank page instead of giving the error "404 Not Found! - The page you are looking for can not be found." as it happens in any other part of the site.
See screenshot. - MSAnsweredIt might be due to 500 error, you can check the code and logs to error detail.
- HRAnsweredHello Mian, it does not generate any error, I think the screenshot did not arrive, where I did the test directly from the DEMO "https://sma.tecdiary.net/"
Just what happens if I enter any character after "page /" it opens a blank page instead of giving the error "404 Not Found! - The page you are looking for can not be found."
Example: https://sma.tecdiary.net/page/other
Where "page / other" does not exist.
Kind regards.Attachments - MSAnsweredOh Ok I will update the page method in next update. For now you can add the code below in `page` method of the shop controller `app/controllers/shop/Shop.php`
```php
if (!$page) {
redirect('notify/error_404');
}
``` - Login to Reply