Very easy and simple .htaccess & PHP tutorial

If you work with PHP, you notice that this URL: is not pretty at all. There is term “Pretty URL” and a lot of tutorials how to make your URL prettier. In this post I’m going to share a few line of .htaccess codes to make your URL more prettier.

Let’s go back to that URL. Here is the goal, we want to make a fake URL like this: that redirects us behind the scene to that ugly URL (

Here is what we need to add to our .htaccess file:

Read this post to know how to create an .htaccess file:

$1 in that code is a variable. So if a user opens this URL: then the value of $1 is number 110.

Do you like this post? Consider a donation 😀

Published by


Habibie is an Indonesian freelance frontend-backend web programmer and cross platform mobile app developer. He's also good at graphics design, video editing, visual effects and animation.

Leave a Reply

Your email address will not be published. Required fields are marked *