It's taken me approx a week to get this sorted but I think I now have it. Have tested it and it seems to work.
You need to make sure you enable the SEO tick box from admin/system/settings/server in opencart admin.
The "pretty links" match the SEO-Keywords you put into each product and category. They need to be unique and best to use and underscore instead of a space ie: yourproduct_moredetail_etc
Copy and paste into notepad and then save in your webroute as rewrite.script
RULE_0_START:
# get the document root
map path into SCRATCH:DOCROOT from /
# initialize our variables
set SCRATCH:ORIG_URL = %{URL}
set SCRATCH:REQUEST_URI = %{URL}
# see if theres any queries in our URL
match URL into $ with ^(.*)\?(.*)$
if matched then
set SCRATCH:REQUEST_URI = $1
set SCRATCH:QUERY_STRING = $2
endif
RULE_0_END:
RULE_1_START:
# prepare to search for file, rewrite if its not found
set SCRATCH:REQUEST_FILENAME = %{SCRATCH:DOCROOT}
set SCRATCH:REQUEST_FILENAME . %{SCRATCH:REQUEST_URI}
# check to see if the file requested is an actual file or
# a directory with possibly an index. don't rewrite if so
look for file at %{SCRATCH:REQUEST_FILENAME}
if not exists then
look for dir at %{SCRATCH:REQUEST_FILENAME}
if not exists then
set URL = /index.php?_route_=%{SCRATCH:REQUEST_URI}
goto QSA_RULE_START
endif
endif
# if we made it here then its a file or dir and no rewrite
goto END
RULE_1_END:
QSA_RULE_START:
# append the query string if there was one originally
# the same as [QSA,L] for apache
match SCRATCH:ORIG_URL into % with \?(.*)$
if matched then
set URL = %{URL}&%{SCRATCH:QUERY_STRING}
endif
goto END
QSA_RULE_END:
You need to make sure you enable the SEO tick box from admin/system/settings/server in opencart admin.
The "pretty links" match the SEO-Keywords you put into each product and category. They need to be unique and best to use and underscore instead of a space ie: yourproduct_moredetail_etc
Copy and paste into notepad and then save in your webroute as rewrite.script
RULE_0_START:
# get the document root
map path into SCRATCH:DOCROOT from /
# initialize our variables
set SCRATCH:ORIG_URL = %{URL}
set SCRATCH:REQUEST_URI = %{URL}
# see if theres any queries in our URL
match URL into $ with ^(.*)\?(.*)$
if matched then
set SCRATCH:REQUEST_URI = $1
set SCRATCH:QUERY_STRING = $2
endif
RULE_0_END:
RULE_1_START:
# prepare to search for file, rewrite if its not found
set SCRATCH:REQUEST_FILENAME = %{SCRATCH:DOCROOT}
set SCRATCH:REQUEST_FILENAME . %{SCRATCH:REQUEST_URI}
# check to see if the file requested is an actual file or
# a directory with possibly an index. don't rewrite if so
look for file at %{SCRATCH:REQUEST_FILENAME}
if not exists then
look for dir at %{SCRATCH:REQUEST_FILENAME}
if not exists then
set URL = /index.php?_route_=%{SCRATCH:REQUEST_URI}
goto QSA_RULE_START
endif
endif
# if we made it here then its a file or dir and no rewrite
goto END
RULE_1_END:
QSA_RULE_START:
# append the query string if there was one originally
# the same as [QSA,L] for apache
match SCRATCH:ORIG_URL into % with \?(.*)$
if matched then
set URL = %{URL}&%{SCRATCH:QUERY_STRING}
endif
goto END
QSA_RULE_END:
Thank you this ALMOST works perfectly after struggling with it. However this now strips all images from showing - any ideas?
Also after a lot of searching for it, I discovered the script required to redirect non www's to www which is better for webmaster tools & SEO - just change the .com.au suffix to suit your site:
# Script to perm 301 non www to www
match IN:Host into $ with ^YOURDOMAIN\.com\.au$
if matched
match URL into $ with ^/(.*)$
if matched
set OUT:Location = http://www.YOURDOMAIN.com.au/$1
set OUT:Content-Type = text/html
set RESPONSE = 301
set BODY = Moved
goto END
endif
endif
Also after a lot of searching for it, I discovered the script required to redirect non www's to www which is better for webmaster tools & SEO - just change the .com.au suffix to suit your site:
# Script to perm 301 non www to www
match IN:Host into $ with ^YOURDOMAIN\.com\.au$
if matched
match URL into $ with ^/(.*)$
if matched
set OUT:Location = http://www.YOURDOMAIN.com.au/$1
set OUT:Content-Type = text/html
set RESPONSE = 301
set BODY = Moved
goto END
endif
endif
Last edited by dallym on Thu Oct 21, 2010 11:31 am, edited 1 time in total.
Yes it allows in Zeus the same functionality the mod rewrite code your .htaccess file has for an Apache server. Enables Search Engine Friendly (SEF) URL extensions after you have selected this functionality in the backend of Opencart (admin/system/settings/server)
Zeus is a type of webserver. This is no different from the standard seo urls. It's simply something to make them work with the Zeus webserver instead of apache webserver which they are designed for. If you do not know what Zeus is you do not need this because it is HIGHLY unlikely that you have it. Apache is used for the VAST majority of webhosting.jones wrote:what does zeus? mean why is it called Zeus? what the different Zeus SEO URLS with OC SEO URLS already? which better?
many thanks
OpenCart commercial mods and development http://spotonsolutions.net
Layered Navigation
Shipment Tracking
Vehicle Year/Make/Model Filter
UPDATE: I sorted out why my images aren't showing with the help of tb800m. I had a space in one of my image directories and the script doesn't tolerate spaces or any non standard URL characters in either filenames OR directory paths. So it's now all working perfectly at http://www.safetytrainingdownloads.com.au. FIXED.
And yes Xsecrets is right. Zeus is a pain and I didn't know my webhost used this type of server instead of the mainstream Apache. I only found out after I paid for hosting and uploaded my site. If you are in Australia NetRegistry use Zeus - but they have since informed me they do have an alternative Apache server you can migrate to.
And yes Xsecrets is right. Zeus is a pain and I didn't know my webhost used this type of server instead of the mainstream Apache. I only found out after I paid for hosting and uploaded my site. If you are in Australia NetRegistry use Zeus - but they have since informed me they do have an alternative Apache server you can migrate to.
Hi dellym
I still have 404 Page Not Found error when click on any URL. However SEO URL appear in taskbar when I put cursor on any link. But its not working.
what I am missing...!!
I still have 404 Page Not Found error when click on any URL. However SEO URL appear in taskbar when I put cursor on any link. But its not working.
what I am missing...!!
dallym wrote:Thank you this ALMOST works perfectly after struggling with it. However this now strips all images from showing - any ideas?
Also after a lot of searching for it, I discovered the script required to redirect non www's to www which is better for webmaster tools & SEO - just change the .com.au suffix to suit your site:
# Script to perm 301 non www to www
match IN:Host into $ with ^YOURDOMAIN\.com\.au$
if matched
match URL into $ with ^/(.*)$
if matched
set OUT:Location = http://www.YOURDOMAIN.com.au/$1
set OUT:Content-Type = text/html
set RESPONSE = 301
set BODY = Moved
goto END
endif
endif
where in the code i have to put this script?
PalMultimedia, what was the problem with your pages not showing? Im having real trouble getting this to work.
Ive added the rewrite.script into the root, enabled SEO URLs in Opencart settings and tested it on pages which have the SEO keywords set. However I still get 404 errors. Any ideas? Its driving me nuts!
Ive added the rewrite.script into the root, enabled SEO URLs in Opencart settings and tested it on pages which have the SEO keywords set. However I still get 404 errors. Any ideas? Its driving me nuts!
Hi,
I have just downloaded OpenCart this afternoon, which is great (slowly customising), but I am really keen to get the SEO urls working on our Zeus server. Although the hosting company support .htaccess much of the mod_rewrite functionality is not available, apparently.
I have copied the coding into Notepad, saved and uploaded it. Tried saving it in both the main web directory and the shop (/ocart) but I just keep getting an Error 404 when I click on any links that are SEO friendly. Box is ticked in the settings too. Urls that do not not have anything in the SEO box still work okay.
What have I done wrong?...url is http://www.classicvintagetractors.co.uk/shop/
Any help much appreciated!
I have just downloaded OpenCart this afternoon, which is great (slowly customising), but I am really keen to get the SEO urls working on our Zeus server. Although the hosting company support .htaccess much of the mod_rewrite functionality is not available, apparently.
I have copied the coding into Notepad, saved and uploaded it. Tried saving it in both the main web directory and the shop (/ocart) but I just keep getting an Error 404 when I click on any links that are SEO friendly. Box is ticked in the settings too. Urls that do not not have anything in the SEO box still work okay.
What have I done wrong?...url is http://www.classicvintagetractors.co.uk/shop/
Any help much appreciated!
Last edited by vintagetractors on Wed Aug 17, 2011 7:57 pm, edited 1 time in total.
Hi,
I just wondered if anyone had any advice? I am still experiencing the same problem, and do not know where to go from here. Very keen to have SEO urls.
Many thanks in advance.
I just wondered if anyone had any advice? I am still experiencing the same problem, and do not know where to go from here. Very keen to have SEO urls.
Many thanks in advance.
Thanks so much for your script - we host our sites with Namesco too so it was just a matter of uploading your script and it worked straight away without any glitches.
Thanks again for your help - much appreciated!
Konrad
Thanks again for your help - much appreciated!
Konrad
Thanks a million for this script - I'm also a namesco customer and was tearing my hair out trying to find a Zeus equivalent to Apache mod_rewrite. This works perfectly.
Hi redvagang, How did you get it to work?? I am still having problems and wondering what I've missed. If you've solved it with Namesco too I must have done something wrong. Any help much appreciated!redvangang wrote:Thanks a million for this script - I'm also a namesco customer and was tearing my hair out trying to find a Zeus equivalent to Apache mod_rewrite. This works perfectly.
Thanks
Hi vintagetractorsvintagetractors wrote:Hi redvagang, How did you get it to work?? I am still having problems and wondering what I've missed. If you've solved it with Namesco too I must have done something wrong. Any help much appreciated!redvangang wrote:Thanks a million for this script - I'm also a namesco customer and was tearing my hair out trying to find a Zeus equivalent to Apache mod_rewrite. This works perfectly.
Thanks
I just copied the script exactly as tb800m wrote it and put it into a file which I named rewrite.script, then put that into my root folder. (You also need to turn on SEO urls in the Opencart settings of course.) It worked perfectly straight away for me. I'm using Opencart 1.5.1.1 by the way.
Now I'm trying to find a way to 301 redirect my old .htm urls to my lovely new Opencart SEO urls, but haven't been able to find any Zeus script that works for that yet. If anyone has cracked this one I'd be very grateful if they could share the solution.
Hi redvagang,redvangang wrote:Hi vintagetractorsvintagetractors wrote:Hi redvagang, How did you get it to work?? I am still having problems and wondering what I've missed. If you've solved it with Namesco too I must have done something wrong. Any help much appreciated!redvangang wrote:Thanks a million for this script - I'm also a namesco customer and was tearing my hair out trying to find a Zeus equivalent to Apache mod_rewrite. This works perfectly.
Thanks
I just copied the script exactly as tb800m wrote it and put it into a file which I named rewrite.script, then put that into my root folder. (You also need to turn on SEO urls in the Opencart settings of course.) It worked perfectly straight away for me. I'm using Opencart 1.5.1.1 by the way.
Now I'm trying to find a way to 301 redirect my old .htm urls to my lovely new Opencart SEO urls, but haven't been able to find any Zeus script that works for that yet. If anyone has cracked this one I'd be very grateful if they could share the solution.
I'm still having problems so I've asked Namesco for advice too...I have copied the script and uploaded, ticked the SEO box but still no luck.
Re. your 301 query...I am pretty sure the you can use the 301 redirect rule in .htaccess. Although Namesco are Zeus they do support this function. Hope that helps.
Who is online
Users browsing this forum: No registered users and 86 guests