Alloy and Pretty URL canonical indexing

Thanks for the update.
After this update, ?id= theres essentially a duplicate page of every post, is it possible to rewrite the canonical to point to the pretty url?

If not then it looks like it would be better not to use pretty urls.

The canonical URL is created when the page is loaded. If you visit the pretty URL page that page’s URL is used for the canonical. If you visit the non-pretty URL then that URL is used for the canonical. It, along with the rest of the blog related content is dynamic and generated at page load.

I can look at it further to see if there’s a better way to approach it in the code, but it will unfortunately be a little while before I can do so as I have to finish up the other large project I’m working on first, unless I find some time to squeeze this in as well.

BTW: if you should take the time to update again, is it possible that you can fix the following at the same time?

if you have activated the “pretty url” it would be nice if this is also transmitted the pretty url in the RSS feed? i think this would make it a little easier for google to understand the structure of the page and the “correct” pretty url will be indexed …

but please do not stress … the large project is of course more important. when does it come out? :see_no_evil: :hear_no_evil: :speak_no_evil: :dash:

thank you again for your support.

1 Like

The RSS feed would need to wait until a major update of Alloy I suspect.

No announced date yet. :wink:

@Imperial — So it looks like there’s a possibility that I could make the canonical always be the Pretty URL when Pretty URLs are enabled, but it would take making a change in the way the “Pretty URLs for Blog Posts” checkbox works within the Alloy Control Center settings. In doing so though when users updated to the new Alloy version with that change it would turn Pretty URLs off for everyone who has them enabled currently.

This is due to the fact that I’d be changing the checkbox’s scope to be a page-wide variable, and thus the Stacks API thinks it is a new variable and resets it. This is not an acceptable outcome unfortunately as it would cause a lot of problems for a large number of users.

Alternatively I could add a new checkbox for enabling this feature separate from the “Pretty URLs for Blog Posts” checkbox, but this comes with a downside as well. Users could enable this checkbox, even if Pretty URLs are off, and would then create problems for them. This second option is the lesser of two evils, but honestly, not ideal either.

As with all things in life there are limits. The limitation here comes from how I have to interact with the Stacks API.

Would like to know your thoughts and any thoughts others might also have.


i understand and can comprehend why you do not want to implement the first solution. although it would probably be the best one.

the second variant (new checkbox) is then probably the more charming solution of the both and would prefer this.

Yeah, option one is without a doubt a no-go. It would be the best one and make things the easiest all round, but would also cause serious problems that would generate a tsunami of support for me.

I’ve thought on it a lot this morning and I can’t think of another alternative, besides the extra checkbox, that would work within the constraints I’m under right now. I’ll keep thinking on it though as I forge ahead on my current stuff.

1 Like

Could this be helped by adding all blog entries the the sitemap?

I am not a sitemap expert so I can’t answer your question directly. That said – Alloy cannot modify the sitemap file. Well, to be more precise, I wouldn’t modify the sitemap file as then Alloy becomes the one responsible for creating and maintaining your sitemap file, and that is not what Alloy is for.


you can use the Alloy rss.xml file :wink:

Thank you Pegasus. I’m looking for a work around. I’ll add the RSS file.

if you use this for the googlesearch console … you can submit both … the sitemap.xml and the rss.xml

Done, waiting to see what happens. I had the sitemap already loaded, it didn’t include blog pages, I added two to see if it would index them overnight, it didn’t.

I added the RSS xml and it sees all the pages, will see if it actually indexes them tomorrow.

Thank you again for your help.

are you using “pretty url”? if so… i would not advise it. without - ALLOY runs perfect.

I have almost 10 blogs running with Alloy - all are indexed and also have a google ranking.

I do have pretty URLs turned on, wasn’t aware this typical use case didn’t work.

I have 25 post, if I turn off pretty URLs what’s the impact? Do I have to delete and reload the post?

I’ll confirm the other settings. As of now, with the RSS.xml, it sees the pages but hasn’t indexed them. I’ve manually requested some pages, one of them was indexed.

If you turn off pretty urls you can always write a redirect for each url in your htaccess file.

Just disabled the “Generate Social Tags” option. Not sure how to disable the canonical URL.

that’s right. and I can really recommend it …

it is already working - but it can brings some nasty problems… take look in this thread

you can just turn off the pretty url … but make sure you also delete the “pretty url” entry in in your htaccess file.

give google one week … then your pages should be in index

Thank you! I’ll report back next week.

if you don’t use a canonical URL for your BLOG everything is fine … the correct canonical URL then sets ALLOY for you