Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Use apache and mod_rewrite rules to maximize seo urls with oscommerce


ttoomey

Recommended Posts

Posted

I've completely customized my store's urls using several contributions including SEO-G for my URLs and header tags to get custom titles and meta keywords and meta descriptions but I decided to take it a step further and maximize my urls while masking the .html or .php

 

Two notes before I continue

1. If you are using header tags you will have to change the header_tags.php include file to whatever you change your urls to, not for example FILENAME_ABOUT_US instead if you decide to title your pages as such: domain.com/about t hen you would have to replace your rules to say "/about" rather than FILENAME_ABOUT_US

 

2. I highly recommend you have some knowledge of apache and backup your configurations because this took some time to get working properly. You will need to edit either your httpd.conf or your .htaccess file and put in rules, that is why I recommend having some experience with apache.

 

Here's an example of some of my rules in my .htaccess:

 

RewriteEngine On

# Next line must be changed to match your osCommerce folder - the relative path

RewriteBase /

RewriteRule ^/contact/$ /contact_us.php

RewriteRule ^/contact$ /contact_us.php

RewriteRule ^/about/$ /about.php

RewriteRule ^/about$ /about.php

RewriteRule ^/all_t-shirts/$ /allprods.php

RewriteRule ^/all_t-shirts$ /allprods.php

RewriteRule ^/faq/$ /faq.php

RewriteRule ^/faq$ /faq.php

RewriteRule ^/checkout/$ /checkout_shipping.php

RewriteRule ^/checkout$ /checkout_shipping.php

RewriteRule ^/login/$ /account.php

RewriteRule ^/login$ /account.php

RewriteRule ^/conditions$ /conditions.php

RewriteRule ^/conditions/$ /conditions.php

RewriteRule ^/rss$ /rss.php?language=en

RewriteRule ^/rss/$ /rss.php?language=en

RewriteRule ^/submit$ /submit.php

RewriteRule ^/graphic_t_shirts$ /index.php?cPath=3_34

RewriteRule ^/mens_t_shirts$ /index.php?cPath=3_27

RewriteRule ^/womens_t_shirts$ /index.php?cPath=3_28

RewriteRule ^/rocker_t_shirts$ /index.php?cPath=3_33

RewriteRule ^/skull_t_shirts$ /index.php?cPath=3_31

 

It might be a better idea to put this in your apache configuration rather than in your .htaccess because it will then configure itself when apache runs rather than everytime there is a server call to your directory. I also can't stress enough how important it is to remember to go back and customize the header_tags.php include file if you are using header tags or else your pages will get the default title/description/keywords rather than what you have defined. I found this out the hard way and spent a good hour trying to figure out how to get it working again.

 

More tips to come!

Assault

If you want to find it you'll have to google "Assault T-Shirts" because posting my damn url in my signature is against the forum rules.

T-Shirts with an edge

Powered by OSCommerce + about 20 different custom addons and some Wordpress

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...