Make your own music website/blog:

G-Zip and htaccess settings

DISCLAIMER: The following notes are from my own experience and experiments and is not a paid endorsement.


Why do you need a website/blog?

Earth While it is true that Facebook Pages offer a lot of options for presenting your media (audio/video/photo galleries), a website gives you more control and your listeners/followers access to more details and media. In my case, I write about the behind-the-scenes for projects that I post in addition to detailed write-ups for tutorials from my YouTube posts.

But what about the costs?

For over a decade, I've used Google's Blogger for two reasons: it's FREE and has most of the commonly required widgets and functionalities to run a standard blog.

Once I reached the point where its limitations held me back, I switched to server hosting, which allowed me to write and style the way I wanted and host other media files as required.

What kind of knowledge does one require?

Webmaster I'm a Computer Science graduate with well-practiced knowledge of HTML, CSS, and JavaScript; if those three terms sound weird to you, DON'T WORRY! It's not as bad as it seems, and in the video above, I take you step-by-step to create your very own music blog. Most of the commonly required snippets for tweaks and customizations are readily available on a simple Google search, depending on what you need.

Advertisement

Investing in hosting your website

Firstly, it has become way cheaper (you can get great deals on long-term plans) to host your site. In my case, for a 3-year hosting plan and a 5-year domain name registration, I paid USD 135 and USD 60, respectively.

Of course, cheaper is a relative term, and you should consider all of the costs before deciding to switch. Not all service providers are alike, and most companies keep coming up with new options and pricing discounts. Do your research before committing!

Yes, but what about all the existing links?

To avoid dead links, we unleash the power of the .htaccess file. Since I was already using a custom domain name, this redirect tells the server where to find a particular page (Redirect 301). Over time as Google and other search engines send crawlers through your site, these redirects become obsolete. I recommend retaining all of your redirects since others may have linked your content manually on their profile/blog post.

In the following example snippet, I'm telling the server that my 'about.html' page is now called 'biography.html'
Redirect 301 /about.html /biography.html

Use 404 to redirect back to your index.html

I used to have an elaborate 404 explanation page till I decided to simply have a redirect instead. Now if a visitor clicks on a dead/incorrect link on my website, they are immediately redirected to the main homepage itself.
<html>
<head>
<meta http-equiv="refresh" content="0; URL=http://www.abijahgupta.com">
<meta name="keywords" content="automatic redirection - 404">
</head>
<body>
<a href="http://www.abijahgupta.com">If your browser doesn't automatically redirect within a few seconds, please click here manually.</a>
</body>
</html>


G-Zip compression

GZIP compression creates a ZIP archive of all pages on a web server before the page is sent to the visitor, thus saving bandwidth and increasing the loading speed of the page significantly. The visitors' web browser then automatically unzips the pages. The compressing and unzipping takes a fraction of a second.

GZIP compression is not recommended for graphical files and .zip files because it hardly saves space and can therefore increase the loading time.

Place the following code in the .htaccess file:
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
AddOutputFilterByType DEFLATE application/x-font
AddOutputFilterByType DEFLATE application/x-font-opentype
AddOutputFilterByType DEFLATE application/x-font-otf
AddOutputFilterByType DEFLATE application/x-font-truetype
AddOutputFilterByType DEFLATE application/x-font-ttf
AddOutputFilterByType DEFLATE application/x-javascript
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE font/opentype
AddOutputFilterByType DEFLATE font/otf
AddOutputFilterByType DEFLATE font/ttf
AddOutputFilterByType DEFLATE image/svg+xml
AddOutputFilterByType DEFLATE image/x-icon
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/javascript
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/xml

# Remove browser bugs
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
Header append Vary User-Agent
</IfModule>

Key Takeaways

iTunes/Apple Music
Spotify
Shazam
Youtube
Deezer
E D Q M W G © Abijah Gupta 2023