sitemap

What Content-Type value should I send for my XML sitemap?

别说谁变了你拦得住时间么 提交于 2019-12-17 03:57:09
问题 I thought I should send "text/xml", but then I read that I should send "application/xml". Does it matter? Can someone explain the difference? 回答1: The difference between text/xml and application/xml is the default character encoding if the charset parameter is omitted: Text/xml and application/xml behave differently when the charset parameter is not explicitly specified. If the default charset (i.e., US-ASCII) for text/xml is inconvenient for some reason (e.g., bad web servers), application

Sequence contains no matching element - Return SiteMapNode matching custom attribute using LINQ

做~自己de王妃 提交于 2019-12-14 04:19:07
问题 I have a Web.sitemap file using the siteMapNode elements in XML. I have added custom attributes to each tag. I am trying to extract the value of the custom attribute id . I want to find a single siteMapNode in the SiteMapNodeCollection which matches the custom attribute id . I am able to achieve this using a foreach loop, but I want to use LINQ to make it short and sweet. --DOESN'T WORK-- The function is as follows: private SiteMapNode FindNodeById(SiteMapNodeCollection nodes, int

C# Change my sitemap from ashx to xml

时光怂恿深爱的人放手 提交于 2019-12-13 19:30:53
问题 My sitemap is at: http://localhost/scirranew/sitemap.ashx <%@ WebHandler Language="C#" Class="SiteMap" %> using System; using System.Web; public class SiteMap : IHttpHandler { public void ProcessRequest (HttpContext context) { context.Response.ContentType = "text/xml"; } public bool IsReusable { get { return false; } } } As far as I know, google will be OK with this. But I would like it to be a .xml filetype for consistency throughout my site. I've tried rewriting the URL: <rewrite url="^~

Linking a visual sitemap with a web application

久未见 提交于 2019-12-13 19:25:24
问题 I have spent a LOT of time browsing the web to find a solution to my problem with no avail. I have a web application with lots of pages. Many of the pages have their respective child pages, and some of these childs also have other childs, and so on. The web application is just the UI which means that it is the HTML mockups. What I need is some way (obviously with the help of an application) how can I connect the folder which has all these HTML files with a visual Sitemap. I also need that

Django sitemap - double http:// in front of URL

半世苍凉 提交于 2019-12-13 04:56:50
问题 In Django 1.4.12, I have a Sitemap class: class MySitemap(Sitemap): def items(self): return ['/my/url1/', '/my/url2/',] def location(self, obj): return str(obj) and in urls.py sitemaps = { 'global': MySitemap, } ... urlpatterns = patterns('', ... url(r'^sitemap\.xml$', 'django.contrib.sitemaps.views.sitemap', {'sitemaps': sitemaps}), However, my generate sitemap.xml has http://http:// in front of it, such as: ... <url><loc>http://http://mywebsite.com/my/url1</loc></url> ... What is causing

Create dynamic sitemap from URL with Ruby on Rails

白昼怎懂夜的黑 提交于 2019-12-13 04:38:59
问题 I am currently working on an application where I scrape information from a number of different sites. To get the deeplink for the desired topic on a site I rely on the sitemap that is provided (e.g. "Forum"). As I am expanding I came across some sites that don't provide a sitemap themselves, so I was wondering if there was any way to generate it within Rails from the top level domain? I am using Nokogiri and Mechanize to retrieve data, so if there is any functionality that could help to

unable to write xml sitemap in cakephp

你。 提交于 2019-12-13 02:41:53
问题 UPDATE To make it a little more clear to some about what's going on, my page does NOT display the document tree(the first time I've ever seen this). Just one long line of my xml content WITHOUT any xml elements/tags. I followed this tutorial for creating a dynamic sitemap in cakephp. This tutorial was written in 2008 and I (have inherited) am working in a cakephp 1.3 app (I am assuming this tutorial would be valid for 1.3? I've looked at some others that pretty much used the same code from

Dynamically update sitemap.xml in Azure webrole

↘锁芯ラ 提交于 2019-12-13 02:25:28
问题 I am moving my existing website to Azure. In azure webrole I have 1. Website at default port and 2. Service at another port lets say :8000 Now my website creates some dynamic pages and the requirement is to update the sitemap.xml with the new URLs. At development stage I am able to create and update the sitemap.xml file from service. But this is not possible on staging server. I am unable to understand why is it happening.Can any one tell me about a solution where I can create a sitemap.xml

ASP.NET MVC - Simple Breadcrumbs (SiteMap)

依然范特西╮ 提交于 2019-12-12 19:40:55
问题 I have developed a ASP.NET MVC 2 application and I want to put a simple breadcrumbs (sitemap) in each page like this: Home > Movies > Details It is equal the URL: http://localhost/home/movies/details How can I achieve it? I would like to put it in my master page. Thanks! 回答1: If it is always equal to the URL, the absolute simplest thing would be to make use of that by using something like this: var menuitems = Request.Url.AbsolutePath.Split("/".ToCharArray(), StringSplitOptions

Display data from database in sitemap.xml using cakephp 2.0

匆匆过客 提交于 2019-12-12 19:22:37
问题 I have created a file sitemap.xml and stored in app/webroot/ and this is a file I can view from browser like this example.com/sitemap.xml . I have created sitemap function in controller where I will get data from database and pass to view/listings/sitemap.ctp . Also I have added Router::connect in app/config/routes.php file. Problem is that data is not showing in the example.com/sitemap.xml file? Listings Controller File: var $name = 'Listings'; var $components = array('RequestHandler');