
|
quotes | stories | poetry | contact | links |
![]() |
|
You've found the blog of Jere Matlock, a web designer and writer. This journal is mostly about writing, web design and getting sites to the top of the search engines (SEO is my business). It is also full of opinions and observations about pretty much everything. If these things are not of interest to you, feel free to go now. Go on, shoo! Still here? If you have something to say, post a comment or send me an email. By the way, if you feel like taking offense at something posted on this site, go right ahead, it won't bother me a bit. Kingsley Amis has a nice quote about that, in which I take solace and some pride when the flames arrive: "If you can't annoy somebody, there's little point in writing." |
|
|
7 Responses to “Using .htaccess to make search engine-friendly URLs – “There is no spoon””Leave a Reply |
||
![]() |
![]() |
November 15th, 2009 at 5:40 pm
Wow thanks a lot for your reply, not used to getting feedback this fast, and such excellent one too.
This is pretty much exactly what I was looking for. I guess any further information, for example on dynamic generation of the .htaccess files
should be available via google.
Thanks again,
-Jan
December 8th, 2009 at 1:40 pm
Thanks for the info, but I have a different question more database related. I would like to have the url like this;
domain.com/products/category/product-title
category and product-title with be tables in the database. How can I get it to search the database for the proper category and product?
How could I get the .htaccess file to forward the variables to the PHP page,which can search for the category and product-title, then generate the page?
Thanks in advance,
Jim
December 8th, 2009 at 3:03 pm
If you want to have your website using page names something like this:
http://www.hubcaps.com/dodge/66-valiant-hubcaps
that’s fairly easy to set up using a RewriteRule in .htaccess
RewriteEngine On
RewriteRule ^dodge/66-valiant.php /display.php?category=dodge&year=66&model=valiant [L]
February 19th, 2010 at 12:33 am
This is great. Thank you.
It obviously allows people to get routed to the right part of your database but how does a search engine know what to look for? Does it spider the .htaccess file?
February 20th, 2010 at 11:19 pm
No – Google never sees the .htaccess file (it’s inaccessible through normal browsing).
Instead, when Google requests the page, in much the same fashion as a person browsing the page would request it, the server creates it “on the fly” and gives it to Google based on the action of Google requesting the page. It’s fast and it works. This is how to show elegant, search-engine-friendly URLs while having the actual content come from a database by using question marks, product ids, category ids, and so on. In practice, it works great!
February 23rd, 2010 at 6:00 am
hi
i have any dynamic page like this in my site:
http://mirsoft.net/detail.php?siteid=433
how can i change to this : http://mirsoft.net/detail-433.html by .htaccess file.
thanks.
February 23rd, 2010 at 10:39 am
Hi, Abbas -
Test this code in your .htaccess file, to see if it works:
RewriteEngine On
RewriteRule ^detail-433.htm /detail.php?siteid=433 [L]
—————-
Here are some tutorials on using .htaccess that you may find useful:
http://softexpert.wordpress.com/2007/10/15/learn-htaccess-in-10-minutes/
http://www.thejackol.com/htaccess-cheatsheet/
http://www.javascriptkit.com/howto/htaccess.shtml
Good luck!
Best,
Jere Matlock