Alternative Short URLs to Product Pages
In the search engine friendly links tutorial, we showed you how to create a specific type of link to a product page, from a category page - i.e. one that looked like this:
http://www.mydomain.com/pc/Adv_Sales/Semin/Advanced+Sales+Seminar
where:
Domain | http://www.mydomainname.com |
Product Code | Adv_Sales |
Product Name | Advanced Sales Seminar |
Category Code | Semin |
Category Name | Seminars |
Store Code | Develop |
But, what if you prefer one of these alternative link styles?
- http://www.mydomainname.com/pc/Adv_Sales/Seminars/Advanced+Sales+Seminar
- http://www.mydomainname.com/pc/Adv_Sales/Semin/Advanced+Sales+Seminar.html
- http://www.mydomainname.com/pc/Adv_Sales/Seminars/Advanced+Sales+Seminar.html
- http://www.mydomainname.com/pc/Seminars/Adv_Sales/Advanced+Sales+Seminar.html
- http://www.mydomainname.com/pc/Seminars-Adv_Sales-Advanced+Sales+Seminar.html
Then, here are the changes you would make to your link in the CTGY Category Product List Layout and to the .htaccess file:
Original: http://www.mydomainname.com/pc/Adv_Sales/Semin/Advanced+Sales+Seminar and also
1. http://www.mydomainname.com/pc/Adv_Sales/Seminars/Advanced+Sales+Seminar:
Mod_Rewrite instruction:
RewriteCond %{REQUEST_URI} ^/pc/(.*)/(.*)/(.*) [NC]
RewriteRule (.*) /mm5/merchant.mvc?Screen=PROD&Product_Code=%1&Category_Code=%2&Store_Code=Develop [L]
i.e. there is no change to the Mod_Rewrite instruction from that contained in the original tutorial.
Then the following links in the CTGY Category Product List Layout give these URLs:
Original. <a href="/pc/&mvta:product:code;/&mvta:category:code;/&mvta:product:name;"> gives the URL: http://www.mydomainname.com/pc/Adv_Sales/Semin/Advanced+Sales+Seminar
1. <a href="/pc/&mvta:product:code;/&mvta:category:name;/&mvta:product:name;"> gives the URL: http://www.mydomainname.com/pc/Adv_Sales/Seminars/Advanced+Sales+Seminar
2. http://www.mydomainname.com/pc/Adv_Sales/Semin/Advanced+Sales+Seminar.html and also
3.
http://www.mydomainname.com/pc/Adv_Sales/Seminars/Advanced+Sales+Seminar.html:
We need to add (.*) to the Mod_Rewrite instruction:
RewriteCond %{REQUEST_URI} ^/pc/(.*)/(.*)/(.*)(.*) [NC]
RewriteRule (.*) /mm5/merchant.mvc?Screen=PROD&Product_Code=%1&Category_Code=%2&Store_Code=Develop [L]
Then the following links in the CTGY Category Product List Layout give these URLs:
2. <a href="/pc/&mvta:product:code;/&mvta:category:code;/&mvta:product:name;.html"> gives the URL: http://www.mydomainname.com/pc/Adv_Sales/Semin/Advanced+Sales+Seminar.html
3. <a href="/pc/&mvta:product:code;/&mvta:category:name;/&mvta:product:name;.html"> gives the URL: http://www.mydomainname.com/pc/Adv_Sales/Seminars/Advanced+Sales+Seminar.html
SEO Information and Tools:
- Web page analyzer - Analyze any or all of your store pages for the "on page" factors that search engines take into account when determining search engine rankings. Check your pages to see how they measure up. Check your competitors pages too. Just paste the URL of the page you wish to examine and click the "Analyze" button!
- Search engine friendly links tutorial for Miva Merchant webstores
- How to create short URLs to MM5 Custom Pages
- Short URLs for Windows IIS Server hosted Online Stores
4. http://www.mydomainname.com/pc/Seminars/Adv_Sales/Advanced+Sales+Seminar.html
We reverse the order of the Product code and Category code in the Mod_Rewrite instruction:
RewriteCond %{REQUEST_URI} ^/pc/(.*)/(.*)/(.*)(.*) [NC]
RewriteRule (.*) /mm5/merchant.mvc?Screen=PROD&Category_Code=%1&Product_Code=%2&Store_Code=Develop [L]
Then the following link in the CTGY Category Product List Layout gives this URL:
4. <a href="/pc/&mvta:category:name;/&mvta:product:code;/&mvta:product:name;.html"> gives the URL: http://www.mydomainname.com/pc/Seminars/Adv_Sales/Advanced+Sales+Seminar.html
5. http://www.mydomainname.com/pc/Seminars-Adv_Sales-Advanced+Sales+Seminar.html
We replace two of the backslashes with hyphens in the Mod_Rewrite instruction:
RewriteCond %{REQUEST_URI} ^/pc/(.*)-(.*)-(.*)(.*) [NC]
RewriteRule (.*) /mm5/merchant.mvc?Screen=PROD&Category_Code=%1&Product_Code=%2&Store_Code=Develop [L]
Then the following link in the CTGY Category Product List Layout gives this URL:
a) <a href="/pc/&mvta:category:name;-&mvta:product:code;-&mvta:product:name;.html"> gives the URL: http://www.mydomainname.com/pc/Seminars-Adv_Sales-Advanced+Sales+Seminar.html