MonoX support board

Start the conversation, ask questions and share tips and solutions with fellow developers.

Non-registered users can only browse through our support boards. Please register now if you want to post your questions. It takes a second and it is completely free. Alternatively, you can log in without registration using your credentials at major sites such as Google, Microsoft Live, OpenId, Facebook, LinkedIn or Yahoo.

Rewrite help (Zatvorena) (Mono Support )

16746 put(a) pogledan, 5 odgovor(a) 29.12.2011. 14:00:22Kreirao(la) rule128
rule128

rule128

29.12.2011. 14:00:22
Hello

I need to remove the "monox" string from all the urls. Ex:

"http://localhost/MonoX/Pages/SocialNetworking/Groups.aspx" I would like to transform it to
"http://localhost/SomeNewName/Pages/SocialNetworking/Groups.aspx"

How can I do this?

Regards
Ovaj sadržaj još nije ocijenjen. 
265 Reputacija 29 Ukupno objava
denis

denis

29.12.2011. 14:39:17
That particular URL is not rewritten, and points to the actual path in the file system. You could add your own rule in the UrlRewritter section of the web.config file. Following your example, it could look like this

<rewrite url="^(.*)/SomeNewName/Pages/Groups.aspx$" to="$1/MonoX/Pages/SocialNetworking/Groups.aspx" name="MyGroups" urlPattern="/SomeNewName/Pages/Groups.aspx"/>
Ovaj sadržaj još nije ocijenjen. 
7207 Reputacija 956 Ukupno objava
rule128

rule128

29.12.2011. 16:57:06
Hello Denis

Thanks for the response. It works fine.
I have one more problem now.
If I use the links from the generated menu I get links like:
"http://localhost/MonoX/Pages/SocialNetworking/Groups.aspx"
how can I chnage them to:
"http://localhost/SomeNewName/Pages/SocialNetworking/Groups.aspx"

Regards
Ovaj sadržaj još nije ocijenjen. 
265 Reputacija 29 Ukupno objava
denis

denis

29.12.2011. 17:13:54
Rewritten URLs cannot be picked up automatically by the navigation menu. The easiest way to accomplish this would be to go to the Page admin section of the admin backend, remove the existing navigation link from the left pane (right click on it and choose delete, it will remove only the menu item, and not the actual page), and than enter a new item - right click on the left pane, choose "New external page", enter the name and the URL (/SomeNewName/Pages/SocialNetworking/Groups.aspx).
Ovaj sadržaj još nije ocijenjen. 
7207 Reputacija 956 Ukupno objava
rule128

rule128

30.12.2011. 9:58:54
Thanks this works great
Ovaj sadržaj još nije ocijenjen. 
265 Reputacija 29 Ukupno objava