Route address

In a folder (named it) on the site I have a home.php file
I would like the address to be https://xxxxx.com/newtext instead of being https://xxxxx.com/it/home.php when opening the page
i tried to use route, but it doesn’t work.
The setting is:


Into code home.php file:

The .htaccess file:
Schermata 2020-12-20 alle 22.28.41

Hi Marzio,

Looks set up correctly. It seems the routes have not been uploaded. Click on both icons at the top of your routes panel to upload them.

I have done this several times and besides the .htaccess file has been modified on the server. Maybe the problem is that the home.php file is in the it folder, while the htaccess file is in the site root folder?

solutions?

The <base> tag seems to be missing on the page. Enable it in your project settings and re-save the page:

Screenshot 2020-12-21 at 15.30.16

actually this is not the problem because the code was only further ahead and I repositioned it before the meta, but the result does not change

So what do you have in the page head now and what exactly the problem is?

This is the configuration

So what is the exact problem you are having?

"It doesn't work" tells us nothing about the problem you are having,

Teodor
maybe I didn’t quite understand the function of the route, but with the setting I configured I expect https: // xxxxxxxxxx / newtest to appear in the browser address. Instead it always appears https: //xxxxxxxx/it/home.php

Marzio, you are creating a route.
When you load:

yoursite.com/it/newtext

The page will load.
Also your path seems wrongly configured, it must start with a / like:

Screenshot 2020-12-21 at 18.34.38

I corrected it but the page is still in the / it / folder, while the htaccess file is in the root

Schermata 2020-12-21 alle 17.42.48

I don’t understand what do you mean. The htaccess should be in the root. The PATH is what you enter (what you want your site load).

Now actually if I type https: // mysite / en / newtext it opens the page
But I would also like that if you type https: //mysite/it/home.php it would automatically redirect to newtext

Marzio, routing is not working like that. It does not do redirects.
You define a path and a page to be loaded on that path. It's not creating any redirects.

Ok sorry but I didn’t understand.
So if you type http: //www.xxxx.yy the address is necessarily the original one

I said a stupid thing
I need to edit the index
Thanks now I understand

If you have this page:

https://mysite.com/folder/another_folder/some_file_name.html

and you create a route for it:

https://mysite.com/mypath/

when you load https://mysite.com/mypath/ it will load the content of https://mysite.com/folder/another_folder/some_file_name.html

^ That is how the routing works and that is how the routing is supposed to work.

If you enter https://mysite.com/folder/another_folder/some_file_name.html it will load the page itself and NOT do any redirects.

Hope my explanation is clear.

1 Like

Yes Teodor
now I understand where I was wrong
thanks

1 Like