Closed Tuckie closed 8 years ago
I'm open to this as a concept but I won't have any time to dedicate to it for the foreseeable future. I do love pull requests though. :)
Great to know :) I'll probably take a shot at it next week.
@Tuckie Are you sure this has to be a new feature?
Couldn't you just iterate over all sitemap.resources
that are also Middleman::Sitemap::AliasResource
instances and build your own .htaccess
resource using a standard middleman template.
I suppose you're right; closing!
Would it be possible to add an option (or two) to this for generating an .htaccess file instead of the redirect pages? If possible, I would like to preserve the referrer, and a server-side redirect seems to be the only way to do it.
RewriteRule #{@alias_path} #{resource.url} [QSA, R=301]
Taking things a step further, we could even do something like:
RewriteRule #{@alias_path} #{resource.url}?#{@alias_parameter}=#{url_encode(@alias_path)} [QSA, R=301]
This would allow tracking on the referrer as well as the alias itself.
Thoughts?