2

Basically, I want to host a website through a CDN. My website currently contains a few URL's with parameters, eg.

http://example.com/articles.html?start=20

I want my website to look like the website used to look (eg. it should respond with the same page as originally when the user visits the parameter URL).

Seeing as this is a CDN host, I cannot use .htaccess etc. which is why I'm asking the question here rather than resolve it myself.

Is there any way to name the file (including the parameter) so it responds to the URL above?

EDIT: Spiders need to be able to properly crawl the content, so JS won't do the trick here.

8
  • What kind of CDN is it? Often a CDN is just a caching server in front of your actual server, which will relay initial requests to your origin server. So… nothing much needs to change. Commented Oct 17, 2016 at 15:37
  • Possible duplicate of How can I get query string values in JavaScript? Commented Oct 17, 2016 at 15:38
  • You should parse query parameters and use them to customize the layout of your site. It can be done with javascript. Commented Oct 17, 2016 at 15:40
  • @damienc So… you're suggesting to rewrite the entire site to move from server-side templating to client-side templating? Hmmmm… Commented Oct 17, 2016 at 15:42
  • My website currently contains a few URL's. This doesn't look like the entire site, does it? Commented Oct 17, 2016 at 15:44

1 Answer 1

3

Try name your files exactly as URL you desire, for example articles.html?start=20. If the CDN server is not configured to handle it and you cannot change the configuration, you are out of luck.

(I assume the CDN server is plain file hosting without any server-side scripting.)

If your URLs are not publicly known yet (so you can change them), you can use a static website generator. URLs will look different (no ?), but it will work.

Sign up to request clarification or add additional context in comments.

2 Comments

Hmm initially I didn't think I could use '?' in the file names. However this might be enabled after all. I'll take a look at it.
You can't on Windows, but Linux (and others) allow anything except '\0' and '/'.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.