Question

I'm trying to figure out a generic permalinks structure for blogging, in order to be platform-independent. I know that Wordpress supports permalinks, and has some plugins for various permalinks style migration, but I also have to get it working in FlatPress and PivotX, and I don't have URL rewriting support in every place.

So far, I will try to use a folder like /permalinks/ into which an index.php file would redirect to the actual post, e.g. /permalinks/index.php?external-link-01 would redirect to /index.php/2009-02-03/external-link-01 or /index.php/e=42, based on the actual blogging platform being used.

For nicer permalinks, and to avoid URL rewriting, I could create a subfolder for each permalink (like /permalinks/external-link-01/), in which the default index file would do the redirection.

So,

  1. Is there a nicer way to maintain this kind of permalinks?
  2. What kind of redirect must I use?
  3. What can I do in order to allow bookmarking the permalink after the redirect? (e.g. the current page is /index.php/e=42 and the bookmark should be /permalinks/index.php?external-link-01)
Was it helpful?

Solution

Why would want to create a bunch of folders with index files in them? That seems like it would become a real nightmare to manage in the longer term. Why do you want to avoid URL rewriting? Mod_rewrite seems like a clean and centralized and ultimately flexible system that will be easier to manage in the long term.

Not criticizing, just curious to understand the motivation of your project.

As for redirect I think you want do a

301 moved permanently

That way the redirect is understood correctly by the search engines. And you won't have errant urls lost in SEO land if your permalink system goes down.

You might also consider throwing in a URL shortening scheme in your system as well.

http://www.shauninman.com/archive/2009/08/17/less_n

And if you have a system with multiple references to different URLs but the same content be sure not to forget about Canonical Links.

http://www.mattcutts.com/blog/canonical-link-tag/

OTHER TIPS

You could potentially implement a fairly simply system based on folders with indexes all simlinked to a single php script which then is then tailored to redirect users to the article of choice (hint: you can implement this fairly easily using the url and preg_replace). This may have a slight performance hit when compared to mod_rewrite but it should be blogging platform independent and allow you to ensure that your links will never become broken (even if it even worse and your host does not allow simlinks, you could just copy the file).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top