Richy Code

Best Blogger tutorials and Tech Tricks website.

Monday 5 November 2018

REMOVE .php and .html extension from website url


There are lots of questions that go into RICHY </ > Technical, about how to remove the .php and .html extensions on the website .
One easy way you can do is to edit the .htaccess file on hosting. Editing .htaccess files can be done via cPanel or Plesk, via the file manager and then click edit on the .htaccess file.
Following are the steps:
  1. Remove the .php extension Use the following script to replace the .php extension
    "RewriteCond% {REQUEST_FILENAME}. Php -f"
    this command works to find the .php file
    "RewriteRule ^ (. *) $ 1.php"
    This command works to delete files with the extension .php
  2. Remove the .html extension Use the following script to replace the .html extension
    "RewriteCond% {REQUEST_FILENAME} .html -f"
    this command works to search for .html files
    "RewriteRule ^ (. *) $ $ 1.html"
    This command works to delete files with the extension .html
For additional information, the above script sometimes cannot be used on some CMS such as WordPress or Website Builder like Weebly, because it has its own .htaccess structure or changes in extension from the permalink side.
So the guide to removing the extension .php and .html with .htaccess , hopefully useful.

How to connect to your database using php


<?php
$host = "localhost";
$username = "root";
$password = " ";
$database = "database name";


$conn = mysqli_connect("$hostmysql","$username","$password");

if (!$conn) die ("Connecttion Failed");

mysqli_select_db($database,$conn) or die ("Database Not selected); 


?>

Code Explained

STEP 1: 

$host = "localhost";
$username = "root";
$password = " ";
$database = "database name";

This is the basic details you provide when you are using a localserver like XAMP, WAMP OR MAMP on your computer. The details may changed you have customize your server or when you are using an online server you will be given your server details

NOTE!: If you are using Xamp or Wamp or maybe Mamp the $host name is always localhost and $username is always root leave the $password empty!

STEP 2: 


$conn = mysqli_connect("$hostmysql","$username","$password");


Once you have completed the first step, You now have to create a variable and a fuction that connects to the mysql database using the details above. 

$conn is just a variable i used to connect, (You can name yours anything eg: connect etc). mysqli_connect is the function use to connect to a database.
you the put the name of your variable in the first step in a parentheses or round brackets ( ) if i may say. with this step if there is no errors, The you are connected.

STEP 3: 


if (!$conn) die ("Connecttion Failed");


When coding in php, you must always check for error first. what the above means is that we are telling php that when the $conn variable which is assigned to the mysqli_connect fails, then we use a function called die() which alerts us that "The connection failed"; and also stops the process.


STEP 4:

mysqli_select_db($database,$conn) or die ("Database Not selected); 

What the aboves means that mysqli_select_db( ) function selects the database that you named in STEP 1, but when it fails the die() function alerts that Database is not selected but connection is made. this could be that you type a wrong database name or the database does not exit .


If you got no error message then that means you have sucessfully connect to your mysql database and you can include that connect in your projects.

Conclusion


the ! sign means not, it is used to check for errors and always mostly used in php statements.




If you have any problem in connecting your database or any php issue don't forget to send me a message or leave your question in the comment section. Share this post guys.

Sunday 4 November 2018

Oware Jnr- Afe Sesee



One of the all time powerful Ghanaian Gospel of all time by Oware Jnr. and he calls it afe sesee( A year by tthis time ). The song simple means ' My heart rejoice because a year by this time, Everything will be okay" Hope you enjoy it.

Lindanda - Lifoko du ciel




I heard of this song from a Radio station in Ghana and since them i loved the song thou i don't understand. I think it is in a Kenyan local language. I don't really understand the words but base on a youtube comment i came to realize that the song is taking about how jesus christ cleaned us from sins and made his sons and dauthers. i hope you guys will enjoy it.

Awurade Kasa



I have been inlove with this song since i was a kid. It is in a native language(TWI). This is simple saying "Oh God, Please speak in my life for thing to be better." Hope you enjoy it even if you don't understand.

How to rename Blogger label

Related image
Having a decent category structure on your site makes it easier for your reader to navigate and find the right content. This is the reason why Blogger offers Labels aka categories so that you can properly organize your content in a systematic manner. As your sites started to grow, there is always a room for an improvement. You might need to change the name of your labels or merge them with other labels. In this article, we will show you How to properly rename or Delete Labels in Blogger. 


Blogger offers an enjoyable easy-to-use Label management area Located at Posts >> Labels. Through this option, you can manage, edit or can even quickly delete labels with just few clicks. There is a straightforward way to add/ Remove or rename Labels.

The first thing you need to do is to select a certain label from the “Label Value Area”. On selecting, it would show up all the articles filed under certain Label. Check out the following screenshot for details.

You need to select all posts through the check box allocated next to the title of your posts. After selecting the posts properly, press the “Label action button” present just above the list of your posts. On pressing it a drop down window will appear, select “New Label” and enter a fresh label name which you want to give to your selected posts. Once done, press the OK button to conclude.

After adding a new Label, you would surely want to remove the old one so again select all the posts through the check box present beside the title of your post. Again select the “Label action button” and from the list of your all labels scroll down to the one which you want to remove and just select it and Bam. 


Congratulations, your posts are successfully moved to a new label. Now whenever you will try to access your old label it would display a 404 error, which means it is properly moved to a newer location. 

Precautions:

  1. You can edit up to 50 posts at a time. If you selected more than 50 posts then, it would probably show you some errors. 

  2. Make sure you are selecting the correct Label to edit because if somehow choose a wrong one it might mess up everything.  

  3. Labels have nothing to do with SEO because they are neither get index nor shown in the Search results so renaming, moving or adding a new category would not show any impact on your Search engine traffic.

Why Blogger has Better SEO Options Than any Free Platforms

While choosing a perfect blogging platform people always questions about one thing, does it is better for SEO?  The half of the world prefers Blogger while the rest recommends WordPress but ultimately both has their own pros and cons.  People always think Blogger is not a suitable platform to create a professional website, mainly because it does not provide flexible options to optimize your site for SEO. What most people don’t know is that Blogger is probably the simplest and most powerful platform and it also has decent SEO score. In this article, I will provide an in-depth detail Why Blogger is better than WordPress or any other free platforms in Terms of SEO? In the end, we will also reveal what Matt Cutts thinks about Blogger SEO.  

What Option Does Blogger Offers for SEO?

Custom Permalink Structure: 

By default, blogger provides constructive permalinks. In spite of all this, blogger also offers a robust option to choose custom URL (permalink) for your posts. You can choose select few keywords and can use them in your URLs so that it can generate decent organic traffic from search engines. However, keep in mind stuffing your permalinks with many keywords would decrease the weightage of your keywords altogether. The more keywords you will add in the permalinks, the less will be the keyword weight and hence, its relevancy would be lower in the search results.  


Separate Meta Description for Posts:

When you are searching anything on Google, you always see a piece of text line just beneath the search results. Those lines are there to help you to determine whether that’s the site which you were looking for. If you would not specify a Meta description, search engines will automatically establish a description for you based on your site’s content. Fortunately, there is a handy tool in blogger located at Settings >> Search engine Preference which enables you to specify separate Meta descriptions for your site’s content. 


Custom Redirects Functionality:

What would you do, if you want to move your content from one URL to another? You would prefer to use a 301 Permanent redirect so that all the PageRank juice transfers from one page to another. Without pointing a redirect, there is no way you can recover the loss. Blogger also has custom redirect functionality which helps you in redirecting URLs to any page.  This tool can be accessed through Settings >> Search engine Preference >> Custom Redirects.  


Customizable Not Found Page:

Blogger often creates a custom 404 not found page to provide some sorts of comic relief to their readers, and protects them from seeing unfriendly or unentertaining error messages. If you have a broken link on your blog, or a reader navigated to a link which was temporary down then the custom 404 not found page would assist them in finding the content which they were looking for. You can customize your error page from Settings >> Search Preference >> Custom Page Not Found. 

How to Rank Well in Search Engine?

Build Real Backlinks: 

The most significant thing you need to rank well in Search engine is Backlink. No, I am not talking about tons and heaps of backlinks because a few bunch of quality backlinks could take your site from ground to the heavens. It doesn’t matters whether you are using WordPress, Blogger or any other platform, without having a decent amount of backlinks your site cannot rank well. 

Writing Fresh Content: 

Writing fresh and unique articles is another way to divert the attention of your visitors. Now you might be thinking how a piece of content would help you in ranking? Why People always prefer to write fresh and high quality content? Search engines don’t know the difference between a high quality content and low quality content. They always analyze the number of quality backlinks that the content is getting from other sources and hence labels it as Quality content. For Example, you write an article which was so exclusive that a person decided to write on the same topic with a credit link back to your website.

What People Thinks About Blogger SEO?

About few weeks ago Google’s employee and the head of web spam team Matt Cutts posted a video on YouTube answering some SEO questions about blogger. 

Here’s the question:
I’ve used Blogger for 3 years, but now everyone tells me that WordPress is superior for SEO. After scouring many sites, I’ve been unable to find the SEO advantages to using Blogger – are there any?

Here’s the Answer: Blogger is quite straightforward to get started, and it is in the cloud. You don’t need to download or install any software yourself. On the other hand, if you install software yourself like WordPress, then you are usually not patching it, so it is easier to get hacked. If you are just doing spontaneous blogging and just starting out then Blogger is fantastic.

Blogger can work very well in terms of ranking well for search engine.  If you get decent links and if you have excessive content then, it is absolutely the case you can rank well on blogger. You must give it a try because blogger can work exceedingly well with SEO

Conclusion: 

It is just a matter of fact that how well you write and present your articles. Platform does not matters a lot because we commonly see many HTML based sites ranking way quite well in the search engine. Those sites are ranking well just because of quality backlinks and content not because they are using WordPress or any other platform. Stop regarding Blogger for unfriendly SEO options because they are way better than any other platform even WordPress. If you like this article, then feels free to share it with your friends on Facebook and twitter.