Custom ActionLink with support of domain routing - asp.net-mvc-3

I have application that accepts four different types of routes. Keyword link is the link of specific page and keyword user is the user that is the owner of the page.
Custom ActionLink should generate links on page depending on route taken to get there. Those links can be:
http://localhost/SiteEdit/user/link
http://www.domain.com/SiteEdit/user/link
http://user.domain.com/link
http://www.user.com/link
It has to create absolute links, because if relative links are used user can enter the page with http://localhost/SiteEdit/user and the default page will be displayed but if clicked on link it would become http://localhost/SiteEdit/link.
thnx in advance

The following link should help:
http://hanssens.com/2009/asp-net-mvc-subdomain-routing/
Update:
Try this gist: https://gist.github.com/RyannosaurusRex/4145948

Related

Joomla Submit article redirect to homepage

I have site that user can submit an article in frontend . I have create menu submit article, but when i click it , it redirect to homepage.
Thank you
The guidelines are here: Joomla : How to create an article from the front end.
Go through below:
Your menu item should not have access to only special members if you are submitting content as registered member. In short, you should maintain the access level of the page.
There can be some other cases, for which you must need to post the screenshot if any error message shown on the screen to debug. As you know there are many settings, custom code, and tweaks that Joomla CMS allows to implement.
To change the redirection when submitting an article I found it useful to do the following:
Associate the form that enables you to create an article from the frontend to a menu, and then edit the corresponding element of the menu, on the options tab, select the redirection after submission category to where you want it to redirect and that's it. Hope it helps anyone!

Blog Link in magento

I'm working in magento blog
i have 2 store views each one for different country
the problem is when we add the blog link in the social media page .. we must to write only one store view in the URL
How can i add a blog URL that match with customer store view
ex: if customer from store view 1 open the link .. the URL will be (example.com/storeview1/blog)
and if customer from store view 2 open the link .. the URL will be (example.com/storeview2/blog)
I tried to make the URL be (example.com/blog)
but it refers to 404 page
Try this.
Open Admin panel
Goto System->Configuration
Change Current Configuration Scope to storeview1 or storeview2 from top of leftbar.
search for keyword blog under "aheadWorks Extensions" at leftbar
Try to change Route to Blog from settings.
Hope this will help some how.

Magento translation and url key

I have a Magento website with some pages linked to main navigation.
For example, in my default view (Italian) I have www.example.com/italian-url-key
Then I created another page for English view with url www.example.com/english-url-key
So, when I am on the italian version of the page and try to switch to english version, this is the url that magento generate: http://www.example.com/italian-url-key/?___store=english&store=&___from_store=default and on click it gives me 404 page.
How can I fix it? I need that this 2 pages should be linked, also if url key is different.
Many thanks!
Out of the box Magento does not support URL Translation, both pages need the same URL key. Check instructions from the Magento Docs on how to translate CMS pages.
To translate a CMS page, you must create a new page that has the same
URL Key as the original, but assigned to the specific store view.
So you will either have to stick to one languages for your URLs or develop/acquire a module to do this for you. The magento-language-roots or CMSRewrites modules both look like they will achieve this for you.
You may also want to consider adding Hreflang tags to your head.phtml as you have a multi-lingual site.

Why is Joomla 1.5 creating different URLs for the same articles on different pages?

I'm trying to understand the way Joomla (1.5) creates article URLs.
I created a module to display news. The module displays all the news, with correct URLs on the homepage mysite/component/content/article/xxxxxxxx.
I created a module to display the last article on the homepage and a button, see all news, linking to a menu item displaying a page with all the articles. The url is: mysite/news.
The problem is the URLs to the article are generated incorrectly as mysite/news/xxxxxxxx and they give a 404. How can I get the URLs to be the same as on the homepage?
Update: The new URL doesn't give a 404, it points to the same page as the menu, I mean mysite/news/ is the same as mysite/news/xxxxxxxx, it shows the list of all the articles and not the article itself
To create proper SEF URLs, two steps are needed:
Be sure to have a menu entry for each article in the list. You don't have to display that menu, it just has to exist. The menu entry's alias is used to build the SEF URL.
When creating links to such an article, be sure to include the parameter Itemid=n in the URL, with n being the id of the menu item. In article texts, use this structure:
index.php?option=com_content&view=article&id=23&Itemid=125
Joomla! will convert that into a SEF URL automatically, and it will still work, when you for some reason turn SEF off.
If you generate links in a module, the URL is not converted automatically. You have to call JRoute::_() for that:
echo JRoute::_('index.php?option=com_content&view=article&id=23&Itemid=125');

how can i get my login page in area?

I have 2 areas in my project: Admins , Members
and I have Login.csthml in view folder.
Therefor,its Address is:
http:localhost.com:5555/Areas/Members/view/Login.cshtml
I want to create the text link "login" at home page of my site ,
when i click on it, it should go to login page that i said above.
i use this code:
#Html.Action("Login", "Members")
but , it doesnt know it should go to Members Area, and it throws an error:
{"The view 'Login' or its master was not found or no view engine
supports the searched locations. The following locations were
searched:\r\n~/Views/Members/Login.aspx\r\n~/Views/Members/Login.ascx\r\n~/Views/Shared/Login.aspx\r\n~/Views/Shared/Login.ascx\r\n~/Views/Members/Login.cshtml\r\n~/Views/Members/Login.vbhtml\r\n~/Views/Shared/Login.cshtml\r\n~/Views/Shared/Login.vbhtml"}
what should i do?
Do you have the area registeration on the Global.asax? When adding an area by right-clicking on the project and using the wizard all the coding for that is done automatically.
Also the address you posted is not correct... it should be something like http: localhost:[port]/[AreaName]/Members/Login
try using this url form to see if the routing is working or not

Resources