Apache URL Rewriter


For Example:
https://www.example.com/test.php?name=bruh

About this tool

This URL Rewriting tool by SEO Helpify is as simple as eating a Domino's Pizza & as fast as The Bugatti Chiron. All you need to do is to enter the URL you want to rewrite & the tool system will process it, returning two types of rewritten URLs.

  1. The First Type is for a single webpage, which elaborates to the fact that a URL will be rewritten to a single script.

  2. The Second Type is for a whole directory, say you want to rewrite all the URLs to a specific directory and then the directory itself parses the filename and returns with the required script.

Copy the desired rules & paste them in a .htaccess file, placed at the root directory of your server or domain.

Why are Pretty URLs or URL Rewriting needed?

Webmasters spend hours and hours thinking about what domain name they should pick, a name that's relevant, concise, & professional. They want to discover a domain name this is applicable, suitable, sounds expert yet is one-of-a-kind, is simple to spell and concise enough to look good on smartphones, looks great on commercial enterprise cards and ends in a dot-com. If they find out that their treasured domain name is already registered by someone back in the '90s, they'll spend thousands just to buy it.

But, ask yourself, is the domain name alone of all that importance? Are the URLs of the pages that are written right next to a domain name not important? Shouldn't they be concise, one-of-a-kind, & expert looking?

For example, have a look at this domain name:
https://seohelpify.com

It looks good, no doubt, but what if you open the profile section and the URL goes:

https://seohelpify.com/profile.php/?id=1234&name=bruh

I bet it doesn't look good anymore, besides, neither search engines nor customers can understand which page it is from the URL. This is where pretty URLs come into play.

How URL Rewriting works

URL Rewriting involves a technique that tells a web server to listen to a URL, while running a script that's not present on that URL. In other words, we can use URLs to non-existent scripts or directories and the server will rewrite those URLs to existent scripts based on the rewrite rules we provide it with.

Have a look at this rewrite rule:
RewriteEngine On

RewriteRule ^profile/(.+)/(.+)/$ profile.php/?id=$1&name=$2

Here, the RewriteRule specifies that whenever the server is requested for profile/anything/something/, the server will rewrite this URL to profile.php/?id=anything&name=something, which looks quite ugly.

Now the unsafe & raw URL we had above, will be re-written as

https://seohelpify.com/profile/1234/bruh/

Which is, to be honest, quite readable and expert-looking. URL Rewriting is such an extensive topic that we can't discuss all of it here since it's not our point of interest right now. You can look at This Article by SmashingMagazine for an in-detail analysis of URL Rewriting.