We have an ASP.NET MVC app that sits on top of a Drupal database (MySQL). Right now this app creates a newsletter and works pretty darn well. However, right now we’re constructing the URL’s like so:
http://baseurl/node/<node-id>
The problem is that the client actually wants the SEO friendly URL instead of this direct URL. Like so:
http://baseurl/news/2012/9/hi-guys-this-is-just-a-test
What’s the best way to get this URL? Is it stored in the database? Only accessible through Drupal specific methods? Should a web service be created in Drupal to take in a node id and return the friendly URL? Something else?
What do you think?
Use the pathauto module. It allows automatic SEO friendly link generation from all kind of properties of the node, including the node id.
In your specific case you’ll need to access the generated URL from the Drupal database using ASP.net. Don’t know about the means to access databases in ASP.net, but you will have to query the
url_aliastable. That table will contain a mapping between the the original URL (node/1234) and the generated URL.