SEO Friendly with GeneXus (Java)

-1

I need to change the format of the URL of a WebPanel, for example move from: http://sitio.com/webpanel?memoria,kingston

a:

http://sitio.com/productos/kingston/memoria

The idea is to do it SEO friendly. I did it with the Tuckey redirect module of the Tomcat, and I also tried the mod_rewrite using Apache as a proxy, but the big problem is that once on the page, GeneXus arms the links using the new url as a url, which is fictitious .

For example, standing in http://sitio.com/productos/kingston/memoria when clicking on a button that has to be carried at the beginning, instead of going to http://sitio.com/inicio goes to http://sitio.com/productos/kingston/inicio

    
asked by user64022 26.10.2017 в 00:59
source

2 answers

1

When you use URL rewriting with GeneXus, you should not only be responsible for resolving the rewriting on the server (that would have been solved), but you should also modify the way you call from one object to another in the code of your objects, so that the links that are assembled, are coherent with the rewriting.

If you had the following before:

TextBlock.Link = Inicio.Link()

You should go on to have the following:

TextBlock.Link = LinkRewrite(Inicio.Link())

Where the procedure LinkRewrite must take charge of adjusting the link returned by Inicio.Link() to be consistent with the rewriting that you are doing.

In general, LinkRewrite will do the opposite to what you have set in the URL rewriting module. That is, if in the rewriting module you make the following transformation:

/productos/kingston/memoria -> productos?kingston,memoria

The LinkRewrite procedure should be invoked as follows:

TextBlock.Link = LinkRewrite(Productos.Link("kingston", "memoria"))

to produce the following transformation:

productos?kingston,memoria -> /productos/kingston/memoria

Within LinkRewrite you should separate the URL received by parameter in parts, and rewrite it so that it has the desired format.

    
answered by 26.10.2017 в 03:30
0

Thank you very much for the clarification.

The problem that I could not solve and I did not mention is when opening a popup.

-If you instantiated the object with the "create" function, using variable & window, open it as link

-If you did it with the PopUp function, also open it as link

-I also tried to create a new ReWrite rule to transform the url to the original folder and format, but it causes a strange result: The popup opens, but including the masterpage in the popup, when it should not.

Finally the solution was:

- Assign the translated url correctly to the "url" property of the & window variable.

(the problem was that before I had tried this last solution without success, because instead of closing the popup it returned to the caller in the same popup, but it was a programming error that the return was not being executed as planned, and was "entering" on the other hand).

Thank you very much again.

    
answered by 26.10.2017 в 16:01