English 中文(简体)
.htaccess gone for deleted, permalink database entries
原标题:

I have event entries in a php application with a permalink structure for the events. I m creating a dynamic xml sitemap for google et al. which creates new url nodes as events are added, and when an event is in the past, the priority level automatically gets adjusted downward.

My question has to do with 404 not found errors if my client decides to delete the event for some reason. I will obviously tell my xml sitemap to remove the url node, but should I be writing to my .htaccess as well with a Redirect gone for those as well since they ll hopefully be indexed with the search engine by then?

I m hesitant to use a script to do any writing to my .htaccess file since it could screw things up royally if something should go wrong.

Thanks in advance.

最佳回答

I m pretty much just following on from what Gumbo said above. The only thing you might want to do is set-up a custom 404 page in your .htaccess so you can forward users to a nicer looking page should they hit it from a search engine; just something along the lines of "Event not found.. but here are some similar events" would be useful to try and get their attention to other areas of your site.

I don t know how your links are set-up but if the link contains SEO keywords you could use those for finding similar events, i.e. if the URL is /events/United_Kingdom/London/100 you could use that information to find similar events in London. If not you could just pull up the latest events or some random ones. You could even modify your delete system to hold onto minimal information of deleted events for the purpose of the 404 page.

You do want to make sure you keep the 404 header so that the search engines won t see all your missing events as duplicate content. If you don t they may penalise your site in the rankings.. no matter how tempting it is to try and fool the search engines into believing this is a genuine page to boost your page count.

Google have published some information on creating useful 404 pages, you might want to check it out.

问题回答

暂无回答




相关问题
how to represent it in dtd?

I have two element action and guid. guid is a required field when action is add. but when action is del it will not appear in file. How to represent this in dtd ?

.Net application configuration add xml-data

I need to add xml-content to my application configuration file. Is there a way to add it directly to the appSettings section or do I need to implement a configSection? Is it possible to add the xml ...

XStream serializing collections

I have a class structure that I would like to serialize with Xstream. The root class contains a collection of other objects (of varying types). I would like to only serialize part of the objects that ...

MS Word splits words in its XML format

I have a Word 2003 document saved as a XML in WordProcessingML format. It contains few placeholders which will be dynamically replaced by an appropriate content. But, the problem is that Word ...

Merging an XML file with a list of changes

I have two XML files that are generated by another application I have no control over. The first is a settings file, and the second is a list of changes that should be applied to the first. Main ...

How do I check if a node has no siblings?

I have a org.w3c.dom.Node object. I would like to see if it has any other siblings. Here s what I have tried: Node sibling = node.getNextSibling(); if(sibling == null) return true; else ...

Ordering a hash to xml: Rails

I m building an xml document from a hash. The xml attributes need to be in order. How can this be accomplished? hash.to_xml

热门标签