skip to Main Content

i have a oscommerce site, i wan to use seo freindly urls, I got a tutorial from here

I basically wanted to change the ID number present in a URL to a URl that will contain name of product or category in it. an example of such url is

http://katanamotorsports.com/innovative-mounts-steel-mounts-prelude-replacement-mount-p-1075.html

i want to modify .htaccess file so that these seo friendly url are actually redirected to respective page with respect to category and product.

i am new bee in learning, and i am totally a new bee in .htaccess

can anybody help me?

2

Answers


  1. You have to use a RewriteRule in your .htaccess to map the external URL (as visible by a user) to your internal version.

    What you want to do is activate the RewriteEngine, then write a RewriteRule that will drop the first part of the URI.

    RewriteEngine on
    RewriteRule ^[a-z0-9-]+-p-([0-9]+).html$ /product.php?id=$1
    RewriteRule ^[a-z0-9-]+-c-([0-9]+).html$ /category.php?id=$1
    
    Login or Signup to reply.
  2. Please don’t use “SEO Friendly” urls like this. They are NOT currently SEO friendly. Search engines liked them 10 years ago. In the last five years they really only hurt.

    • Google gives almost no weight to keywords in the url
    • Google gives weight to sites that it determines satisfy users

    So, don’t design urls for search engines, design them for users. Users like

    • Urls that are short (maybe they can type them or remember them)
    • Urls that are meaningful (They can see what they are about before clicking on them)
    • Urls that don’t contain repetition or numbers like ids

    It would be far better for you to have your url be:

    http://katanamotorsports.com/prelude-replacement-mount
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search