Different index files for different directories on Google Cloud Storage, possible? - google-cloud-storage

Problem: Planning to have my Jekyll-generated static site served from Google Cloud Storage, but need to serve feeds from example.com/feed/ for backwards compatibility with WordPress.
Possible solution: Say the static feed file (index.xml) is located at example.com/feed/index.xml. Then if it's possible to set a different index file for a directory itself (apart from what's set for the bucket e.g. index.html), then people would be able to access my feed from example.com/feed/.
But is this possible? If not, is there an alternative I'd be missing?

You could potentially create an object in the example.com bucket with the name /feed/. That's a bit awkward to think about, and because of the way gsutil works you'd have to do it via the API manually, but it would allow you to serve a feed from example.com/feed/.
Alternately, you could simply name your xml content /feed/index.html. If all of your users are indeed visiting example.com/feed/, then being able to name the file index.xml is not entirely relevant. The only special thing you'd need to do is make sure you set the right content type for the /feed/index.html object.
Another thing to keep in mind here is that the feed itself should be linked from your main index page with a link like this:
<link rel="alternate" type="application/rss+xml" title="My Awesome Feed" href="http://example.com/path/to/feed.xml" />
That gives you the ability to name your feed sanely, and your users can point their feed readers at http://example.com/ directly -- the reader should be able to follow the link to the feed itself. That won't help you if you have established readership that expects a wordpress style feed, but you could steer new people in the right direction and deprecate the weird wordpress style after a while.

Related

How do I rewrite URL to drop file extension for pdf on github pages?

Imagine my website is hosted on GitHub Pages and has a custom domain website.com. I can access a pdf at website.com/mypdf.pdf
Is there a way where I can make it work at website.com/mypdf?
As mentioned in comments, if you are using static website hosted by a 3rd party like GitHub pages, you don't really get a lot of control over http server. I would tentatively say you cannot control URL rewrite rules on GitHub.
What you could potentially do instead is to host a page with a bit of JavaScript that would start the download on a given event (button click, page load, etc) this way you could mask your actual download URL with this html page (that by convention comes with no file extension)
UPD: and surely enough someone's been doing it already: http://lea.verou.me/2016/11/url-rewriting-with-github-pages/. The post is going on about having nice urls, but I believe file downloads implementation can be implemented similarly
Yes you should make your website with MVC structure. Make a controller and in Index action load pdf file.
Then on action calling your pdf will be loaded like that:
Students/AllResult etc

Is it possible to create a canonical URL for pages with just a pageid in confluence?

I need to groups each space in the Piwik web analytics software. The cleanest way to do it would be if all URL´s had the spacekey in it, to allow each space-owner to easily get a complete view of their space and retain all functionality like browsing the site with an analytics overlay.
Some URL´s are canonical, however some just have an URL like /pages/viewpage.action?pageId=199921170
Is there some way through the AJS API or other method to find force a working URL in the form: /display/spacekey/title-of-page
The most important part is to have the spacekey in the URL. If there´s no workaround I might just generate an invalid URL by inserting spacekey and let each space-owner fix their page-titles if they want working analytics :-)
We are running Confluence version 5.10.7
(There´s an unresolved open issue on https://jira.atlassian.com/browse/CONF-11285 concerning the broader issue of sometimes having ugly URLs in confluence)
Instead of adding an incorrect URL, you could use a custom variable to record the space key, e.g.
_paq.push(['setCustomVariable','1','Space Key', AJS.params.spaceKey]);

Entity Property in URL and SEO

I have coded my ASP.NET MVC application in a way that allows stored entities to be retrieved via a friendly name in the URL, for example:
www.mysite.com/artists/james-brown/songs
Where james-brown is a URL friendly string stored on my Artist entity.
Now imagine I add an artist that no one has heard of before, and no one ever navigated to that artist's songs page.
How would Google/Yahoo/Other Search Engines know that my site does indeed have songs for that unknown artist.
Do I create a sitemap and maintain it through code as I add / remove artists?
There are few defined known ways to make the new links visible to search engine world.
XML and HTML Sitemap:
Add it to sitemap and submit it through webmaster tools.
HTML sitemaps are another way to achieve it. If your site has footer sitemap, you can add it to them.
Internal Links
Create internal links from your high ranking pages or highly crawled pages to the new pages. Google and other search engines tend to crawl pages where the content changes frequently. So if you have a refreshed content pages, try adding it to those pages and chances are high for those pages to be discovered quickly.
External Links
Create links from external blogs, company blogs and sites like pagetube.org which can help it to be discovered.
Yeah just add them to either sitemap, internal or even external links

An object in Google Cloud Storage which acts as a "redirect" or "symlink"

I'm looking to move an existing website to Google Cloud Storage. However, that existing website has changed its URL structure a few times in the past. These changes are currently handled by Apache: for example, the URL /days/000233.html redirects to /days/new-post-name and /days/new-post-name redirects to /days/2002/01/01/new-post-name. Similarly, /index.rss redirects to /feed.xml, and so on.
Is there a way of marking an object in GCS so that it acts as a "symlink" to another GCS object in the same bucket? That is, when I add website configuration to a bucket, requesting an object (ideally) generates a 301 redirect header to a different object, or (less ideally) serves the content of the other object as its own?
I don't want to simply duplicate the object at each URL, because that would triple my storage space. I also can't use meta refresh headers inside the object content, because some of the redirected objects are not HTML documents (they are images, or RSS feeds). For similar reasons, I can't handle this inside the NotFound 404.html with JavaScript.
Unfortunately, symlink functionality is currently not supported by Google Cloud Storage. It's a good idea though and worth considering as a future feature.

How can I pull in my BlogSpot page into a page on my web site

I have a blog on BlogSpot.com, and I have a domain based on my own name. I want to have a URL on my site (like http://www.mydomain.com/blog) that will then pull in the content from my blog page, but I want the URL in the address bar to stay on http://www.mydomain.com/blog, so that it does not look like you left my site.
(I have a Windows hosting account on 1and1.com)
I did Google this question, and I found how a few things, like:
1: Adding a tag in to "refresh". Tried this, but it changes the address bar.
<meta http-equiv="refresh" content="0; URL=http://myblog.blogspot.com" />
2: I also learned about the html iframe thing, but it has height and scrollbar issues.
3: Then, I found this partial code snippet, but I don't know what to do with it, or if it will even work against the BlogSpot server, or on my server:
<%
Set objHTTP = Server.CreateObject("Microsoft.XMLHTTP")
objHTTP.Open "GET", "http://myblog.blogspot.com", false
objHTTP.Send
Response.Write objHTTP.ResponseText
%>
I am a client app guy, so this web stuff is all new to me.
Any help will be greatly appreciated.
The third option will probably work for the initial page load, but any links on the page will then direct the user to the BlogSpot page, and change the url. It simply fetches the page from blogspot, and then sends it to the user without any changes.
For me, the changing url is not a big deal, as long as it's easy for the user to get from one to the other easily; have prominent links on either page that tell the user where they go. Most people don't care about the url, they just care about the content.
Using an IFrame is probably your best bet. Many Facebook applications are in IFrames and still integrate very well.
I think using a regular frame or an iFrame is probably the easiest solution. What kind of scrollbar issues did you encounter? You can set custom values for some of these attributes, just check out the documentation here:
http://www.w3schools.com/TAGS/tag_iframe.asp
If you didn't want to use frames, you could actually proxy the entire page using a server side application like Squid. However, this is more difficult to setup, requires the ability to install software and configure firewall/iptable settings on your host, and must be configured properly to prevent malicious abuse.
-Mark
Here are some options you can try:
If you have PHP installed:
<?php
echo file_get_contents('http://myblog.blogspot.com'); // or you can use fopen()
?>
Or Server-Side-Includes installed:
<!--# include virtual="http://myblog.blogspot.com" -->
You can also pull blog content from Blogspot using the Blogger Data API.
The advantage of this is that you can reformat and reorganize the content to match the style of your website. The disadvantage is that it's more work than an iframe, and you probably won't match the full functionality of Blogspot.
I'm playing with this now to see whether I can use Blogspot as a type of CMS for a club news system.