0

I have Ghost blogging platform running in IIS through iisnode.

I want IIS to redirect/rewrite the default path / to something like this /tag/sometag/ so that when someone enters the blog, the site will show the first post under the tag.

In other words I want http://myblog.com/ to be equivalent to http://myblog.com/tag/sometag/.

The trick is that Ghost is a node.js application so I already have a rewrite rule to get ghost to handle the request. The rule is this one:

So all request are passed through and handled by index.js endpoint.

I'm really do not now how to achieve that and so far I read I haven't found something that could help me.

Thank you in advance for you help/

sabotero
  • 4,265
  • 3
  • 28
  • 43

1 Answers1

0

I can't see your rule, but I think this is what you're looking for.

Within /ghost/core/server/routes/frontend.js change:

router.get('/', frontend.homepage);

to

router.get('/', frontend.newfunction);

Then in /ghost/core/server/controllers/frontend.js after:

frontendControllers = {

add:

newfunction: function(req, res, next) {
    return res.redirect(config.paths.subdir+'/[the path]/[you want]/')
},
RichardSJust
  • 106
  • 1
  • 10