Create SEO Friendly URLs With Htaccess Mod Rewrite in 3 Easy Steps

Posted in SEO , Web Development on 18 November 2009 55 comments

Buy Viagra Generic Online. ONLY HERE The Best QUALITY and LOW PRICES



Robaxin over the counter canada viagra generika kaufen ratiopharm viagra generika kaufen per nachnahme zoloft medication interactions. Viagra generika kaufen in deutschland ovofar 50 tablets ocd medication zoloft apcalis sx 10 zovirax cream buy online apcalis sx 20 kaufen. Buy zovirax cream viagra generika 50mg kaufen meddirekt24 viagra generika rezeptfrei kaufen buy zovirax cream canada. Viagra online bestellen in deutschland viagra generika kaufen online viagra generika kaufen günstig. Viagra mail order usa viagra generika online rezept apcalis sx oral jelly - orange 20mg buy zovirax cream online online pharmacy uk ventolin. Kamagra oral jelly zürich buy cheap zovirax cream anti depression medication zoloft apcalis sx 10 mg can you buy zovirax cream over the counter. Viagra generika kaufen erfahrung zoloft depression medication viagra generika kaufen ratiopharm robaxin methocarbamol canada Viagra 60 Pills 50mg $85 - $1.42 Per pill. Viagra over the counter los angeles viagra generika bestellen österreich what is ovofar 50mg tablet viagra generika kaufen express. Where can i buy robaxin in canada viagra generika kaufen express ovofar 100 tablets use of ovofar tablet viagra generika kaufen per überweisung. Can you buy robaxin over the counter in canada zoloft medication for bipolar buying viagra us buy zovirax 5 cream online zoloft headache medication. Buy zovirax cream for genital herpes viagra generika kaufen aus deutschland viagra over the counter united states can u buy zovirax cream over the counter. Viagra generika kaufen auf rechnung buy zovirax cream australia viagra generika kaufen apotheke ovofar 50 mg tablet. Zovirax 5 cream buy online viagra generika kaufen rezeptfrei bestellen viagra generika kaufen vorkasse. Viagra generika rezeptfrei online bestellen viagra generika rezeptfrei kaufen deutschland acheter apcalis 20mg ovofar tablet usage buy zovirax cream cheap. Ovofar tablets used for where to buy zovirax cream online zoloft anti anxiety medication buy cytotec online next day shipping. Robaxin buy canada apcalis-sx 20mg oral jelly robaxin canada apcalis sx 20 mg buy cytotec online fast delivery. Zoloft and anxiety medication viagra generika online ohne rezept buy robaxin canada is robaxin over the counter in canada robaxin online canada. Viagra in usa frei verkäuflich ovofar tablet apcalis sx oral jelly 20mg apcalis-sx 20 mg cena buy zovirax cream online canada.

Bad LausickGießenViagra HallenbergSchwäbisch GmündNeustrelitzWurzenMünchenbernsdorfViagra VogtlBad Doberan


Viagra 120 Pills 50mg $145 - $1.21 Per pill
Viagra 360 Pills 50mg $355 - $0.99 Per pill
Viagra 60 Pills 50mg $85 - $1.42 Per pill
Viagra 90 Pills 50mg $115 - $1.28 Per pill



Viagra comes as a tablet containing sildenafil citrate, to take by mouth. For most men, the recommended dose is 50 mg. taken, as needed, approximately 1 hour before sexual activity. However, sildenafil citrate may be taken anywhere from 4 hours to 0.5 hour before sexual activity. Based on effectiveness and toleration, the dose may be increased to a maximum recommended dose of 100 mg or decreased to 25 mg. The maximum recommended dosing frequency is once per day.

Orlistat buy online cheap Cialis 5mg 30 tablet cost Cheap generic viagra usa Buy viagra online perth australia Buy cialis uk


  • viagra generika rezeptfrei online kaufen
  • viagra online bestellen überweisung
  • viagra generika online kaufen schweiz
  • where is the best place to buy generic viagra


Lexapro vs zoloft libido lexapro 5mg vs 10mg preço viagra generico drogaria pacheco ventolin inhaler canada pharmacy online pharmacy uk generic. Buy retin a online in australia buy jelly viagra online propecia discount online lexapro vs paxil for anxiety. Order xenical online pharmacy viagra generico menor preço lexapro dosage vs zoloft ventolin online canada. Viagra generico preço comprar prozac vs lexapro weight loss buy retin a online australia celexa vs lexapro weight loss. Is ventolin over the counter in canada viagra generico no brasil where can i buy jelly viagra celexa vs lexapro vs paxil. Comprar generico do viagra no brasil buy ventolin canada buy ventolin from canada buy ginseng in canada buy viagra over the counter london. Retin a cream online australia lexapro vs klonopin for anxiety generic viagra jelly lexapro vs celexa anxiety. Lexapro vs zoloft diarrhea buy viagra over the counter in australia buy viagra over the counter usa can i buy ventolin over the counter in canada ventolin inhaler price canada. Escitalopram price vs lexapro buy viagra jelly uk lexapro vs paxil vs zoloft lexapro vs paxil dosage lexapro vs effexor xr for anxiety. Buy viagra jelly online viagra jelly online uk lexapro vs zoloft for ocd buy ginseng seeds canada can we buy viagra over the counter lexapro vs zoloft dosage equivalents. Lexapro generic vs brand lexapro vs generic escitalopram celexa vs lexapro for social anxiety buy ventolin in canada lexapro vs xanax high. Generic viagra sildenafil oral jelly Kamagra oral jelly-nacin upotrebe ventolin buy online canada can you buy viagra over the counter in europe buy retin a cream online australia. Zoloft vs lexapro weight loss lexapro vs celexa for anxiety celexa vs lexapro for anxiety and depression discount generic propecia. Ginseng prices canada Prozac uk buy lexapro vs zoloft depression effexor vs lexapro for anxiety buy viagra jelly online uk retin a buy online australia. Buy viagra over the counter in new york lexapro vs zoloft for anxiety lexapro vs celexa libido where can i buy viagra over the counter in edinburgh. Buy xenical online pharmacy lexapro dosage vs citalopram.

  • Viagra in Burnie
  • Viagra in Port st. lucie
  • Viagra in Meekatharra


Augmentin 625 price singapore viagra online australia cheap augmentin 875 mg price augmentin inj price cheapest viagra online usa. Cheapest cialis 5mg augmentin tablets 625mg price augmentin price singapore cheapest viagra 100mg uk augmentin 1g price in kuwait cialis cheap online. Cost of augmentin xr augmentin new price augmentin price at walgreens augmentin price in nigeria viagra online austria viagra professional vs regular viagra. Augmentin generic price online apotheke viagra kaufen augmentin price at walgreens cheap viagra online us augmentin 625mg price in philippines. Price augmentin philippines augmentin antibiotic price cost of augmentin with insurance augmentin price walgreens viagra professional vs viagra price augmentin 625. Viagra online free cheap generic cialis uk online augmentin price in philippines augmentin duo syrup price in india viagra online hrvatska viagra capsule online purchase. Cheap cialis and viagra augmentin 325 price cost of augmentin 500 mg viagra professional vs viagra super active viagra pills cheap walmart pharmacy price for augmentin. Cheap viagra 100mg canada augmentin 457mg/5ml price best quality viagra online viagra farmacia online españa. Cheap viagra generic canada viagra canada cheapest cheapest viagra in usa augmentin 875-125 mg price colchicine probenecid cost. Is cialis cheaper than levitra buy viagra cheap usa.

Viagra Maple RidgeGriffithWodongaPowell RiverGreater Vancouver
TappahannockNewaygoViagra MinfordBelle VernonCaney
Fraser ValleySydneyBundabergWagga WaggaBrisbane


Generic cialis modafinil 200mg | Original cialis online kaufen | Wellbutrin xl 150 mg generic cost | Cheap cialis free shipping | Viagra originale pfizer online | Gabapentin uk buy


Cialis generika schweiz kaufen acheter cialis luxembourg donde comprar viagra generico viagra available over counter australia. Where can i buy viagra online in australia buy kamagra oral jelly online usa Where can i buy prozac in canada generika cialis kaufen cialis generika kaufen rezeptfrei bestellen. Best sites to buy viagra online uk free viagra sample australia acheter cialis en ligne au quebec brand levitra canada viagra over the counter in australia. Acheter cialis en ligne au québec cialis 20mg kaufen schweiz can you buy viagra over counter uk can i order flagyl online can i buy viagra online in the uk. Generic levitra from canada flagyl back order cialis 5 mg kaufen levitra prices in canada buy metoclopramide online uk is viagra available over the counter in australia. Onde comprar viagra generico em portugal cialis generika wo kaufen buy viagra online safe in australia generic viagra canada price acheter du cialis quebec order flagyl pills. Levitra canada price comprar viagra generico en pamplona buy online kamagra oral jelly cialis 20mg kaufen in deutschland over the counter viagra sydney. Cialis 20mg kaufen erfahrungen levitra generic canada buy viagra online next day delivery uk cialis generika in österreich kaufen. Buy kamagra online in the uk can u order flagyl online viagra over the counter australia where can i buy viagra in australia. Comprar viagra generico contrareembolso em portugal flagyl order online canada acheter cialis en ligne au canada viagra online kaufen sofortüberweisung. Where can i buy viagra in sydney australia buy metoclopramide online buy kamagra online ireland over the counter viagra brisbane cialis generika in frankreich kaufen. Where can i buy kamagra online over the counter viagra adelaide comprar viagra generico por internet acheter cialis ligne quebec viagra online kaufen 24 stunden. Best place to buy kamagra online uk can you buy viagra in uk chemists cialis 5mg kaufen rezeptfrei levitra from canada pharmacy levitra canada drugs. Cialis 5mg online kaufen levitra cost in canada ou acheter cialis canada comprar viagra generico seguro. Levitra cost canada viagra super force australia se puede comprar viagra generico sin receta buy pfizer viagra online australia can you buy viagra online australia. How much does levitra cost in canada buy kamagra online europe buy kamagra online cheap levitra discount canada. Levitra buy canada flagyl online order levitra canada cheap buying viagra in australia online buy kamagra online australia comprar viagra generico por telefono. Can i buy viagra online in australia where to buy kamagra online viagra substitute over the counter australia mail order flagyl is viagra an over the counter drug in australia. Comprar viagra generico internet comprar viagra generico por contrareembolso buy kamagra online next day delivery buy kamagra online uk. Acheter cialis canada levitra 20 mg canada metoclopramide online pharmacy brand levitra from canada what is the cost of levitra in canada. Comprar viagra sildenafil generico cialis generika deutschland kaufen Viagra 60 Pills 50mg $85 - $1.42 Per pill comprar viagra generico portugal. Buy kamagra online canada can you buy viagra in uk shops donde comprar viagra generico sin receta generic levitra online canada acheter cialis québec.

  1. generic viagra cheap canada
  2. pharmacy courses online in uk
  3. generic viagra mail order
  4. viagra online kaufen strafbar
  5. online pharmacy uk antibiotics
  6. online pharmacy uk accutane
  7. viagra generika online kaufen schweiz
  8. viagra online auf rechnung
  9. online pharmacy uk weight loss


< Buy cheap tadalis sx :: Cytotec online australia >

What is SEO Friendly URL and Why?

An example of SEO friendly URL can be seen in this page. Compare it with urls like http://mysite.com/?t=34 , you will find it easier to remember and the it also clearly tells you what this page is about. Furthermore, the words in the URL might match the search keywords, bringing more traffic from search engines.

Make SEO friendly URL yourself

I don’t have to worry about SEO friendly URL in WordPress since its already built-in. However, I need it for my premium wordpress themes website, which is not based on WordPress. So I started to look into this matter.

Using htaccess and mod rewrite, you can make SEO friendly yourself in 3 easy steps.

1. Creating .htaccess file

Open NotePad (yes, the windows notepad) > File > Save As > Change the “Save as Type” to “All Files” > enter “.htaccess” as the name and press Save. You’ve created a htacces file.

Now paste this codes below into it.

Options +FollowSymLinks
 
RewriteEngine On

The first line Options +FollowSymLinks is required for some server configurations.

2. Create your own rewrite rule

Example 1
For example, if you want to change links like http://mysite.com/index.php?topic=rules to http://mysite.com/topic/rules/, here’s the rewrite rule.

?View Code HTACCESS
Options +FollowSymLinks
 
RewriteEngine On
RewriteRule ^topic/([a-zA-Z0-9]+)/$ index.php?topic=$1

• Like regular expressions, the [a-zA-Z0-9] matches lower and uppercase of alphabets and numbers.
• The asterisk inside the brackets + is a quantifier that match 1 occurence to infinite occurences.
• Combining them, ([a-zA-Z0-9]+) matches alphanumerics of at least 1 character.
• The caret ^ means “start with”, meaning the URL starts with the word “topic”.
• The dollar sign $ means “end”, meaning the URL ends with a slash.
• The $1 is backreference, it carries the content of the first group of brackets.

In other words, when user enters http://mysite.com/topic/faqs/ , the page being called and run would be http://mysite.com/index.php?topic=faqs

Example 2
If you want to change URLs like http://mysite.com/index.php?product=productname&price=30 to http://mysite.com/products/productname/30/. Basically its similar to above.

?View Code HTACCESS
Options +FollowSymLinks
 
RewriteEngine On
RewriteRule ^products/([a-zA-Z]+)/([0-9]+)/$ index.php?product=$1&price=$2

• The [0-9] in matches numbers only.
• The plus sign is a quantifier that match 1 or more occurences.
• Combining them, ([0-9]+) means 1 or more numbers.
• Similarly, $1 will be the first brackets : product name and $2 would be the second brackets : price.

Example 3
If you want to change URLs like http://mysite.com/article.php?id=45 to http://mysite.com/article-45.html, here’s how:

?View Code HTACCESS
Options +FollowSymLinks
 
RewriteEngine On
RewriteRule ^article-([0-9]+)\.html$ article.php?id=$1

• The new thing here is the \. (backslash followed by a dot).
• The backslash here “escapes” the dot, so that the dot means a real dot instead of “anything”.

3. Extra Stuff

Custom 404 error page

Put this in your htaccess if you would like to have a custom 404 error page instead of the default one.

?View Code HTACCESS
ErrorDocument 404 /404.php

Change the 404.php to your page.

Disable directory browsing

For security purpose, its best to disable directory browsing so that people won’t know what files you have. Use this :

?View Code HTACCESS
Options All -Indexes
Protect .htaccess files

This should disallow other to access your .htaccess file, just like disallowing others to access your wordpress’s wp-config.php

?View Code HTACCESS
<files .htaccess>
order allow,deny
deny from all
</files>

Others references you might need

Mod Rewrite Syntax

 

Posted by Zen on 18 November 2009 • 216,229 visits 55 comments
Tags : ,


or Subscribe to specific category only :




  - 55 Comments


Toronto Internet Marketing says:

i can imagine it hurts for some people when they find out a long time after they made their URL that their URL is not keyword friendly. After you have built many bcklinks, gotten your reputation, and you have a long lasting domain age.

Doreen says:

Hi Thank u for the Tipps. What is the right Backend-Setting in Permalinks of WordPress.

Allgemeine Optionen: only in german here?
Standard
Tag und Name
Monat und Name
Numerisch
Benutzerdefinierte Struktur

zen says:

For wordpress, I use “Custom Structure” : /%postname%/

Cheers :)

Gary says:

Very helpful post. It has been very difficult for me to find anything good on this topic. thanks.

mark says:

thanks, that was a nice post to go through, I look forward to reading more of your stuff

sovanndy says:

Could you explain about (.*?)?

what does it mean?

I don’t understand this rule

car freak says:

great tips,,thanks a lot

Tanya says:

Ey, what about phpbb3? it is possible do something like that in forums? i found all the time mods like Phpbb seo, but it means a lot of changings the i don’t wanna do.

thanks for the tips!!!

Aurora says:

I too have that problem. This I tried and it only shows on the tab not on the web address in phpbb 3.07_pl. I tried the “easy mod” and that just gave me a blank page and it was NOT easy, so I had to reinstall my board. I hope they find a good solution soon. :)

Balaji J H says:

Thanks a lot
You saved me others worked but redirects to the real url
Only yours does the work

Thanks

Nayan Paul says:

Thanks Sir , Very Handy and useful post..

I have some query about seo friendly url,please help me

My demo site URL looks like
http://www.mydomain.com/index.php?module=listing&action=view&page=1
And Now loooks URL in that format
http://www.mydomain.com/index.php/module/listing/action/view/page/1

How i do that thru htaccess ? please Help Me , Thanks Again….

Ranjan says:

Hey, anybody can help me. I couldn’t able to do url rewriting.
here is my code of “.htaccess” file,

Options +FollowSymLinks
RewriteEngine On
RewriteRule ^name/(.*)/$ rewrite.php?name=$1

Jyoti says:

Hi, Ranjan, Sory i couldn’t get u…
anybody can help him? thanks in advance.

Dhruv Kumar S says:

Hi Ranjan,

If your url is http://www.website.com/rewrite.php?name=ranjan

and if you want it to be like http://www.website.com/name/ranjan/

Use this

Options +FollowSymLinks
RewriteEngine On

RewriteRule ^name/(.*)/$ rewrite.php?name=$1

And make sure your rewrite.php file is written accordingly.

Abhi says:

Hey what to change in rewrite.php file ? thanks in advance

news and updates says:

thanks for your great and value share, actually i’ve been searching for a couple days for it

news and updates says:

i’ve find your blog appear on google, think you have good Seo technic, great job anyway.

Real Estate Analysis says:

Thanks for the easy to follow guide. I needed to create the SEO url’s on my RealEstateAnalysisFREE.com website for a long time, but always had troubles to figure it out. Now I just copied your code, change it a bit and it works like a charm! Thanks.

Needa says:

awesome its helpful :D

Helloo says:

Thank’s

its help my URL be search engine friendly :)

http://www.auctionsbuy.com

Karnataka Medical says:

u gave the information in simple words. ^ key should always be used if it is the start of string which is to be matched, otherwise it will be matching URL names from in-between also, which may create trouble.

medical assistant says:

I tried the follwoing with no sucess:

RewriteRule ^directory/(.*)/$ index.php?q=$1 [L]

SFL: http://example.com/top-directory/directory/123

output to my script: http://example.com/top-directory/index.php?q=123

Can somebody tell me what am i doing wrong?

zen says:

You missed a slash after “123″

Milos says:

Hello, it’s a very good post. I have a little problem:
My pages is:
index.php?=detalji?265
index.php?=detalji?112
index.php?=detalji?221

I want rewrite this pages as:
article-265.html
article-112.html
article-221.html

I made a .htaccess file like this:
Options +FollowSymLinks

RewriteEngine On
RewriteRule ^article-([0-9]+)\.html$ index.php?=detalji?$1

But when i tipe a http://www.lcd.rs/article-221.html I give onli index.php page, not index.php?=detalji?221

Do you now where I make a mistake?

Tnx a lot,
Milos Popovic

learning and teaching says:

great post with good information. Is it possible to make http://anisbd.com/ebooks to browse like a subdomain http://ebooks.anisbd.com with .htaccess ?if yes how do i code it ?bro

chand says:

hi,

i have tried whatever show in this post. but my url is notwoking. see the url and suggesst me how to modify
if i am clicking on any of the menu it is coming like http://www.stage100floors.com/100bestbuy/search.php?categoryId=24.
but in need something like
http://www.stage100floors.com/100bestbuy/products/

my code is like
RewriteRule ^/100bestbuy/products/(.*)/$ 100bestbuy/search.php?categoryId=$1 [L,NC]

i am trying from 3 day but no result in localhost aswellas in server.
help me please…………….

Zen says:

perhaps you can try this:

RewriteRule ^100bestbuy/products/(.*)/$ 100bestbuy/search.php?categoryId=$1

and put the htaccess file in stage100floors.com root.

gozada says:

Hey, anybody can help me. I couldn’t able to do url rewriting.
here is my code of “.htaccess” file,

Options +FollowSymLinks
RewriteEngine On
RewriteRule ^name/(.*)/$ rewrite.php?name=$1

thank you

a.r.bhuyan says:

its very important issue for seo learner .thanks for this post.

Bill Wynne says:

Great tips using the htaccess file!

Zeeshan Parvez says:

Just what the doctor ordered! Exactly what I was looking for to integrate with my cms. I needed a way to get seo friendly urls. Now I have the answer. Thanks!

Jaybee says:

Hi,
I have scanned the internet for a mod rewrite solution to turn my urls from:
http://www.domain.com?section=this&catid=1&articleid=1
to
http://www.domain.com/about-us/the-team (like they do in WordPress)
And I do not want to pass numbers in the urls.

It has forced me to hard code all my dynamic links in my htaccess which becomes tiresome when you add more content onto the website because this method is not automated. eg.

————————————————–
RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^the-team$ index.php?section=this&catid=1&articleid=15 [NC,L]
————————————————–

Please help me come up with a workable automating solution just like they do in WordPress. Note: All the content is stored in a database.

google places says:

Very useful list Zen, .htacces is something I’ve always struggled with and this has helped me get my head around it a bit. Before it was trial and error really but this has helped me understand why I’m actually using each separate line of code. Cheers

mitra says:

Hi Zen, really its a very good tutorial…..
But I have a problem with url rewriting.
My present link is
http://localhost/htaccess/products/product.php?pname=computer&id=5
and I want http://localhost/htaccess/products/computer/5/
So how can I do it? and what should I write within href=”"?
basic folder structure is —
root/products/product.php
root/customers/customer.php
And presently the hyperlink file is within index.php at root folder.

And another thing, there are similar pages like product.php and corresponding different parameters, suppose—
http://localhost/htaccess/customers/customer.php?cusname=mitra&id=10
and I need as same as above
http://localhost/htaccess/customer/mitra/10
So is it possible to write just one rewriteRule to do these all?
if yes, then how?

Thank you.

Arvind says:

Hi,

I have been trying on localhost to rewrite this URL (http://localhost/cms/categories.php?id=1) to (http://localhost/cms/category/1)

I used the following rewrite condition (and also others) in .htaccess file but everytime it has been failed:

Options +FollowSymlinks
RewriteEngine On
RewriteRule ^cms/category/([0-9]+)$ /cms/categories.php?id=$1 [R,L]

can anybody help me to tell where I am wrong?

Thanks for help in advance

arif says:

i have a url like this

http://abc.local/stock/detail.php?id=1 i need to change this like

http://abc.local/stock/product-title.html

i need to show product title which will come from the database

kindly give me a example of my problem

thanks

Toko Online says:

Nice, with htaccess rewrite rule every web url looks easy.
Thanks

Trackbacks

  1. Step 2: SEO Friendly URL | Siddharth Shah | Sid | Siddhath SEO Tips | Sid photography
  2. .htaccess REWRITE RULES | .htaccess REWRITE RULES - .htaccess REWRITE RULES - .htaccess REWRITE RULES = .htaccess REWRITE RULES | NURSING CARE
  3. how can i remove .html from url? - Bizzteams - Page 2

Leave a Reply

You must be logged in to post a comment.

Previous Post
«
Next Post
»