Welcome, Guest ( Customer Panel | Login )




 All Forums
 VPCart Forum
 General help me questions
 SEO Friendly URL
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

vaheh
VP-CART New User

USA
115 Posts

Posted - July 22 2014 :  15:36:00  Show Profile  Visit vaheh's Homepage  Reply with Quote
HI Everyone,

I would like to change the way the website reads SEO friendly URL so page will only care about catalogid.

Right now my URLS are like:
http://www.diamonddoctor.com/products/880-Diamond-Rings-Dallas-Tx/33023-1078-Carat-Emerald-Diamond-Platinum-Eternity-Band/

and soon as you put any character like "A" at the end of the link page brakes.
http://www.diamonddoctor.com/products/880-Diamond-Rings-Dallas-Tx/33023-1078-Carat-Emerald-Diamond-Platinum-Eternity-BandA/

my goal is to change the way it loads the page so it only should care about catalog ID like "33023" in this case and no matter what comes after it.

Any suggestion is appropriated.
Thanks,

diegomilito
VP-CART Expert

Argentina
779 Posts

Posted - July 22 2014 :  22:19:33  Show Profile  Reply with Quote
i dont think your wanted link will work. from my thinking, vpasp cart system seo creating folder per folder of each category and each product inside products folder. with such struture any change to the link of course you are not matching the existing folder to load.
i have no idea what other solution to make. but maybe url rewrite software ?? but i dont know much about how url rewrite will work on your demand.
diego.
Go to Top of Page

vaheh
VP-CART New User

USA
115 Posts

Posted - July 23 2014 :  14:51:48  Show Profile  Visit vaheh's Homepage  Reply with Quote
Hi Diego,

Thank you for your reply. You are right since it is creating a folder with the same name this will not work.
Do you know how we can change this SEO so it will be based on general WEB.CONFIG or HTACCESS rule?
In that case we don''t have to click on Generate SEO like most of other shopping cart systems. I hope in version 8 it works dynamically.

Thanks,
Go to Top of Page

manilow
VP-CART New User

France
134 Posts

Posted - July 24 2014 :  03:41:42  Show Profile  Visit manilow's Homepage  Reply with Quote
Hi Vaheh,

I think the best way would be to use the URL rewrite rules in IIS on your server.

I developped my own SEO friendly URL''s using a field in the product record. In this way, the URL will not change when moving from category or changing the product name. I can generate the product URL by a script or write it manually. A product URL starts with ''p'' followed by the product id, something like : p123-my-product-description.htm.

The URL rewrite code in IIS is :

^.*p([0-9]+).+\.htm.*$

The rewritten URL is :

/shopexd.asp?ID={R:1}&requestedURL={R:0}


The query variable ''requestedURL'' is the exact URL the visitor asked for. Whenever different from the product field seoURL an error will be displayed. Obsolete pages will not be redirected to new pages in order to delete them from search engine indexes.

Kind regards,

Erik
www.aquathermia.com
Go to Top of Page

vaheh
VP-CART New User

USA
115 Posts

Posted - July 24 2014 :  13:35:05  Show Profile  Visit vaheh's Homepage  Reply with Quote
Hi Erik,

Thank you so much for this wonderful shortcut. Did you make any changes inside shopdisplayproducts.asp or shopdisplaycategories.asp or shopexd.asp?

Once again thank you for your help.
Vaheh
Go to Top of Page

manilow
VP-CART New User

France
134 Posts

Posted - August 02 2014 :  17:46:06  Show Profile  Visit manilow's Homepage  Reply with Quote
Hi Vaheh,

I indeed made some changes to the product pages. Below an example for the shopexd.asp page:


requestedURL = request.QueryString("requestedURL") ''requestedURL is written by ISAPI rewrite rule
if left(requestedURL,1)="/" then requestedURL = right(requestedURL,len(requestedURL)-1)
SetSess "backpage", requestedURL ''save current url for return button in shoperror


''700 - 2010.07.08 - Enhancement: Always redirect to SEO link if SEO Dynamic enabled
if ucase(getconfig("xSEODynamicEnable"))="YES" and ucase(getconfig("xSEODynamicProductsEnable")) = "YES" and instr(lcase(request.servervariables("SCRIPT_NAME")),"shopexd.asp") > 0 then
dim friendlyURL
genseoproductlink friendlyURL,cint(CatalogId),"","No"
if friendlyURL <> "" then
if requestedURL <> replace(friendlyURL,"+"," ") then ''replace + by spacing : ISAPI url can''t transmit +''s

''301 redirection code
''Response.Status="301 Moved Permanently"
''Response.AddHeader "Location", xmysite & "/"& friendlyURL

redirecttoseoinvalidpage
''shopclosedatabase dbc
''response.end

end if
end if

end if


Lines in pink are outquoted (obsolete), green lines have been added. I used the redirecttoseoinvalidpage routine to indicate an old url is gone using Response.Status="410 Gone".


The code in shopdisplaycategories.asp and shopdisplayproducts.asp is quite similar.

I hope this will help you further.

Regards,

Erik
www.aquathermia.com

Go to Top of Page

vaheh
VP-CART New User

USA
115 Posts

Posted - August 05 2014 :  18:59:59  Show Profile  Visit vaheh's Homepage  Reply with Quote
Hi Erik,

Thank you so much for your code.
I am going to test this on my site this weekend.

Regards,
Vaheh
Go to Top of Page

serjtankian
VP-CART Super User

Armenia
378 Posts

Posted - August 12 2014 :  08:30:51  Show Profile  Visit serjtankian's Homepage  Reply with Quote
Hi Erik,

Do we need to do something with server to apply your custom code? or we can just paste the code?






*serj*
Go to Top of Page

manilow
VP-CART New User

France
134 Posts

Posted - August 12 2014 :  11:13:50  Show Profile  Visit manilow's Homepage  Reply with Quote
Hi Serj,

Some modifications on the web server are indeed necessary. You need the URL Rewrite option in IIS.

In this module you need to create 3 different URL rewrite rules:

1. products

Name : Products
Model: ^.*p([0-9]+).+\.htm.*$
Rewritten URL: /shopexd.asp?id={R:1}&requestedURL={R:0}

Example:
http://www.aquathermia.com/p348-photometre-piscine-palintest-pooltest-3.htm

Returned page:
/shopexd.asp?id=348&requestedURL=p348-photometre-piscine-palintest-pooltest-3.htm


2. Categories

Name: Categories c
Model: ^.*c([0-9]+).+\.htm.*$
Rewritten URL: /shopdisplayproducts.asp?id={R:1}&requestedURL={R:0}


3. Categories
Name: Categories cat
Model: ^.*cat([0-9]+).+\.htm.*$
Rewritten URL: shopdisplaycategories.asp?id={R:1}&requestedURL={R:0}


I inserted an extra record in the products and categories tables to store the SEO URL (you could use any other field like pother1). This SEO URL is compared to the requestedURL (this value is included in the querystring). If the SEO URL is not equal to requestedURL, shoperror.asp is displayed.

The advantage of this SEO URL approache is that the URL remains always the same no matter the category the product is in, no matter the changes you could in the productname.

It needs some coding .

Kind regards,

Erik
www.aquathermia.com
Go to Top of Page

serjtankian
VP-CART Super User

Armenia
378 Posts

Posted - August 28 2014 :  07:32:28  Show Profile  Visit serjtankian's Homepage  Reply with Quote
you''re so great!

thanks!






*serj*
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Snitz Forums 2000
0 Item(s)
$0.00