Friendly URLs by .htaccess Rewrite

In this tutorial you will learn how to replace your messy URLs with nice ones. There are many reasons to use pretty URLs:

  1. easy to remember
  2. looks great
  3. search engine friendly
  4. easy to link

Here is a messy URL:

http://www.1stwebmagazin.com/index.php?page=articles

And this is the nice URL what we like to have:

http://www.1stwebmagazin.com/articles

Let's get started. Open Notepad or any plain text editor.
Insert this code to your file and save it as .htaccess without any extension:

RewriteEngine On
RewriteRule ^([a-zA-Z0-9_-]+)/?$ index.php?page=$1

The final step is to upload this .htaccess file to your website root folder.


Go Daddy


Related articles

Redirect www to non www with .htaccess RewriteRule

Redirect www to non www with .htaccess RewriteRule

05/12/2015

Redirect your websites visitors from www.domain.com to domain.com without www.

Unordered List Style Image CSS

Unordered List Style Image CSS

06/03/2013

Learn how to style UL with any image using CSS.

OL and UL List CSS Style

OL and UL List CSS Style

03/03/2013

Styling ordered and unordered lists is easy. Just write a single line of CSS to change the list style type.


1 comment

Gary2012-11-05 12:51

Nice article :)

Leave a comment

We welcome any comment from you! Please keep in mind that comments are moderated and rel='nofollow' is in use. So, please do not use a domain as your name or a spammy keyword, or your comment will be deleted.

Name: *

E-mail: *

Message: *

Click on the airplane *


Find us on Facebook

Tags

Get online with the world's Best - GoDaddy.com!

Back to Top