Not sure the title explains what I want to do, so here goes: I have a website constructed with Umbraco 4.5.x and the links in the pages use relative paths. I want to have the domain prepended to these links and don't know how to do that; I didn't really used Umbraco so I am a newby at this :(.
What I want to do is replace links like:
Who we are...
with something like:
Who we are...
or
Who we are...
What are the things that I must do for this? Is it all Umbraco configuration or do I need to write some code? Or both?
I found something about the useDomainPrefixes config but it does not seem to work (not sure if it is even related to what I want to do).
Thank you!
I suggest using UrlAbsolutifierModule ( http://www.paraesthesia.com/archive/2007/12/14/urlabsolutifiermodule---convert-urls-in-asp.net-output-to-absolute.aspx ) or similar.
I finally solved this by using Rewrite rules for IIS, Inbound + Outbound.
I also tried with NiceUrlFullPath but it did not work.
Related
I want to build a .NET site with MVC and have some external links on it. These URLs I don't want to show directly, but through customized ones.
For example: instead of https://stackoverflow.com/questions/69996673/lower-case-urls-in-asp-net-mvc, just only http://example.com/link/1234.
I know in PHP man can do it with .htaccess and a php file but I'm not sure it's possible in ASP.NET. Someone has suggested me to do it with .cshtml but I don't know how.
Can someone please help me to clear this question?
Thanks.
Updated:
Thanks for all your tipps. After reading the 2 pages on codeproject.com you suggested, I just think that these are useful only for internal URLs, for external they seem to be complicated.
I would think that for each external one I will have one URL: http://example.com/link/1234 and then when clicked it will link with one View 1234.cshtml. This cshtml file should then redirect to the actual link (I don't know as it's possible with Razor).
So I believe there must be a simpler way to get the job done. So anyone else
has other ideas, please share! Thanks!
In route.config file you can construct your url as the way you want.
You can use HttpResponse.RedirectLocation Property in a controller to achieve this. For detail use this link.
Response.RedirectLocation = string.Format("http://bit.ly/{0}", linkid));
return new View();
I want to create a webisite like www.customer1.appsglobal.com/login.aspx using asp.net.
Here "customer1" is changed based on different customers. But remaining the url should be same.
For this i have choosen IIS URL-Rewrite concept.
We have a domain is www.appsglobal.com. But using this we can create url's like
http://www.customer1.appsglobal.com/login.aspx
http://www.customer2.appsglobal.com/login.aspx
http://www.customer3.appsglobal.com/login.aspx
so please help me to do like this.
Thanks in Advance
What you have done there is make your customer name subdomain's, so your URL rewrite is not going to work. You will need to write a script that can create these sub domains for you, but I would suggest looking into your host if you don't manage your server your self.
I'm working on a website where I have users view their gallery by typing in "www.example.com/mygallery" As of now they way I have this working is I create a virtual directory called "mygallery", and upload all the project files to it. This works well enough, but it's kind of clunky. Ideally what I would like to do is have the user type in the url (www.example.com/mygallery), and the website goes to "www.example.com/galllery.aspx?name=mygallery". That way there is no need to create a virtual directory for every user.
I have posted a similar question not too long ago about this, but I specifically said I wanted to use url rewriting to accomplish this goal, and did not get any responses. However I am open to any method of accomplishing this. So any help on this subject is greatly appreciated.
Thank you.
If your site isn't MVC, you can still use the RouteCollection mechanism to handle URL re-writing. Check this - http://msdn.microsoft.com/en-us/library/cc668177.aspx
I am writing a small Visual Studio addin to let the user use more features of the comment tokens (TODO, HACK, etc.). For this I want to extend Visual Studio with new commands (such as TODISCUSS, TODELETE, FIXME, TESTME, etc.). I'd like to do this programmatically when my addin starts.
I already found out how to do this manually: http://msdn.microsoft.com/en-us/library/ekwz6akh%28v=vs.80%29.aspx
Does anyone have an idea how this could be done via the API?
Any ideas or suggestions would be appreciated!
Edit :
See this MSDN Link perhaps digging around in TaskList will get you somewhere.
Original Post :
It's not very clear (to me :) what exactly you want to do. Is it: find, edit, or refactor the tokens and then do something else with the sources? I can suggest this article on Code Project (NRefactory).
Using NRefactory you can do anything and everything with the source files including locating the tokens you want and doing stuff with them. You will also know the files you found them in, line numbers etc.
Perhaps you will be able to use Nrefactory to do all the heavy lifting as far as sources are concerned.
I'm currently trying to create a small scale CMS for my personal website and thought I'd like to try to make some sort of a page layout from a basic aspx file with some placeholders and load content based on the URL, without the use of url query strings such as ?pageid=1.
I'm trying to wrap my head around how this can be achieved without getting errors of a physical file not existing when I e.g. type in http://mywebsite.com/projects/w8apps/clock.
I've read a lot about BLOB and storing files binarily in the database. But I haven't come across a blog which points in the direction of using a so called page layout and loading content based on the URL instead of a query string.
I'm not asking for a solution, just some hints - blogs mostly - which can point me in the right direction and help me achieve this goal.
To deal with loading a page with a URL that is more friendly, rather than ?page_id=1, you may want to have a look at this article about URL Rewriting and URL Mapping.
http://www.codeproject.com/Articles/18318/URL-Mapping-URL-Rewriting-Search-Engine-Friendly-U
Hope you can find a way of fitting this kind of code into your application!
You questions is too broad but here are couple hints that will point you in the right direction.
Create clear specs before you start working on this. Do you really need to have URLs like this http://mywebsite.com/projects/w8apps/clock ? If yes then check out MVC since it has best support for this
Storing binary files in database doesn’t have much to do with this. You first need to think of how your tables will look like and that is based on what are you trying to achieve…
I’d suggest you install some CRM that if open source and analyze this first. You’ll probably find a lot better ideas this way. Just go to CodePlex and search for CMS.