Remapping URLS in web.config - url

I need to add a term to the URL's within a sub-directory of a website I'm working on to boost/enhance SEO. For example, http://www.domain.com/shop/product/ should go to http://www.domain.com/shop/product-SEO/ instead. I need to set this up in web.config and looked at examples on here but couldn't find anything similar. Any help?

The feature you are looking for is called URL Rewriting.
You should have a look at the following link, it will provide everything you need:
http://msdn.microsoft.com/en-us/library/ms972974.aspx

Related

Umbraco URL issue with Vorto

I am using vorto plugin in my Umbraco 7 application to achieve the multilingual capability.
I mentioned the URL in hostname as 'localhost/clientname/en'.
Whenever I open login page the URL which is getting form is 'http://localhost/clientname/en/login'.
This is the structure of vorto URL writing.
But can I achieve it like 'http://localhost/clientname/login/en' ???
I want language names at the end of the URL, not in between.
Is it possible ?
Please help....i am badly stuck in my project task !
It sounds like you need a custom URL provider, setting the domain to 'localhost/clientname/en' will mean that the URLs will always get added AFTER the language part as the host is always the first part of the URL.
Have a look at this article on URL providers and content finders: https://24days.in/umbraco-cms/2014/urlprovider-and-contentfinder/ it's quite old, but it should still work. That should give you an idea of how to make it work. Basically you want the URL provider to append the language to the end of the URL, and the content finder to strip the language from the end and then find the actual content. You can also then set the language of the current thread in the content finder so that Vorto and Umbraco are using the correct language based on the URL.

Sitecore gives a blank page with just the text "Default page" in my MVC solution

When I browse to my startpage, e.g. /sv I get a blank page that just says "Default Page". However when I try /sv/ it works. Subpages like /sv/example work without slash though. I'm using Sitecore 7.1 with only MVC views.
Remove the default.aspx file from the web root.
That will fix your problem.
When requesting URLs without a slash at the end, the "StripLanguage" processor of the preprocessRequest pipeline rewrites path to the value of the Settings.DefaultPageName setting ("default.aspx" by default). Since such page physically exists on your site, ASP.NET MVC routing system does not handle such request, and the file itself is served. This behavior is controlled over the RouteCollection.RouteExistingFiles property (false by default), please refer to the following article for the details:
http://msdn.microsoft.com/en-us/library/system.web.routing.routecollection.routeexistingfiles.aspx.
In other case, when a slash is added after a language, this won't happen, since the "StripLanguage" processor does not rewrite the path (which is also not an expected behavior). As a result, request URL does not match the "default.aspx" static file in the site and request is getting processed by ASP.NET MVC.
I suggest you to add the following setting to the "Web.config" file (instead of creating a "default.aspx" page), which points to the "default" page without extension:
<settings>
<setting name="DefaultAspxPageName" value="default"/>
</settings>
After that, the /default URL, without ".aspx" extension, will be processed by MVC and the appropriate item will be rendered independently of a slash after the language URL section.
On my side it works.
I want to point out that the answer to this is not my own but given from the support over at Sitecore who I want to extend a big "Thank you!" to. I had googled this forever until they helped me and I thought that I want to have this document and easily found when others struggle with it. A bug is filed and they are working on fixing it.
DefaultAspxPageName is Hidden Setting.. We can find more such hidden settings..#
http://www.newguid.net/sitecore/2014/sitecore-hidden-string-configuration-settings/

Asp.NET MVC in subfolder

i have searched here, googling (with bing;)) and try all the things i have found but i
dont get it running.
I have a subfolder created on my webspace at discountasp.net like "MySite". Then i
made a virtual directory with the control panel. I published the Site with Visual
Studio to the path
http://blablabla.com/MySite/. My Domain is pointed to this path too.
It looks good but the links like /Home/About/ becomes /MySite/Home/About/ and thats
(of course) doesnt work.
How can i change that ? I think its an routing issue.
Please help me.
To create your URLs you should use
#Url.Action(actionName, controllerName)
This will use the routes you specified and it will create correct URLs.
You can also use
#Html.ActionLink(linkText, actionName, controllerName)
To include images and stylesheets use
#Url.Content("~/Content/...")
I got it. Pointing my Domain directly on the subfolder and defining a
Outbound rewrite rule on iis solves my problem.

Using .htaccess to change my website URLs

I have some pages organised like this:
http://localhost/index.html
http://localhost/download.html
http://localhost/contact.html
And I need them changed to suit the following URL structure:
http://localhost/
http://localhost/download
http://localhost/contact
Without making sub directories and putting in pages as index.html. As far as I know .htaccess can be used for this, but I have no idea what I need to add to my .htaccess file to make this work.
Can anyone provide some help? Thanks.
Are you looking for this? Here's another page. And here's a discussion about it.

Firefox Add ON - To Check for Absolute and Relative Links

Does anyone know if there is some type of tool, preferably a Firefox add on that can check the links on a page if they are absolute links (going to another website) or relative links (within the website)...
I have searched on Google, and the Firefox add ons and haven't seen any. How hard would it be to make my own? What do you guys suggest.
Did you checkout ExNewT ?
btw, it is not that hard to search on addons.mozilla.org, you should have do it yourself.
Write your own Javascript to go through all the elements in the document, or maybe there is a better way to access links using a Mozilla class, and use this guide to discern between absolute and relative links.

Resources