Post by tb800m » Wed Oct 13, 2010 7:52 pm

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:

http://www.bigcitroendeals.co.uk


Newbie

Posts

Joined
Wed Oct 13, 2010 7:45 pm

Post by dallym » Wed Oct 20, 2010 8:58 am

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
Last edited by dallym on Thu Oct 21, 2010 11:31 am, edited 1 time in total.

Newbie

Posts

Joined
Thu Sep 09, 2010 9:13 pm

Post by ifyouseek » Wed Oct 20, 2010 11:27 am

so what does it do? does it make the url unique for each product and category?

Active Member

Posts

Joined
Thu May 06, 2010 4:40 pm

Post by dallym » Thu Oct 21, 2010 11:36 am

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)

Newbie

Posts

Joined
Thu Sep 09, 2010 9:13 pm

Post by jones » Thu Oct 21, 2010 1:06 pm

what does zeus? mean why is it called Zeus? what the different Zeus SEO URLS with OC SEO URLS already? which better?

many thanks

Active Member

Posts

Joined
Tue Aug 24, 2010 1:05 pm

Post by Xsecrets » Thu Oct 21, 2010 7:42 pm

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
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.

OpenCart commercial mods and development http://spotonsolutions.net
Layered Navigation
Shipment Tracking
Vehicle Year/Make/Model Filter


Guru Member

Posts

Joined
Sun Oct 25, 2009 3:51 am
Location - FL US

Post by jones » Fri Oct 22, 2010 11:46 pm

Nice explanation, You're great Xsecrets Many thanks...

then i must ask google for further more about zeus.

Active Member

Posts

Joined
Tue Aug 24, 2010 1:05 pm

Post by dallym » Sun Oct 24, 2010 6:19 am

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.

Newbie

Posts

Joined
Thu Sep 09, 2010 9:13 pm

Post by PalMultimedia » Thu Mar 24, 2011 10:54 pm

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...!!

User avatar
New member

Posts

Joined
Wed Feb 02, 2011 9:17 pm

Post by PalMultimedia » Thu Mar 24, 2011 11:04 pm

error solved... and working perfect now

User avatar
New member

Posts

Joined
Wed Feb 02, 2011 9:17 pm

Post by Heks » Sun May 08, 2011 1:50 am

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?

New member

Posts

Joined
Wed Feb 16, 2011 9:10 am

Post by gsword » Wed May 18, 2011 8:49 am

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!

Newbie

Posts

Joined
Wed May 18, 2011 8:47 am

Post by freewheelin » Sat Jul 02, 2011 4:13 am

A big THANKS for posting this, no doubt saved me hours of searching and sussing!

Cheers
Kris

New member

Posts

Joined
Wed Aug 25, 2010 7:37 am

Post by vintagetractors » Thu Jul 28, 2011 10:46 pm

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!
Last edited by vintagetractors on Wed Aug 17, 2011 7:57 pm, edited 1 time in total.


Posts

Joined
Thu Jul 28, 2011 10:33 pm

Post by vintagetractors » Mon Aug 01, 2011 5:37 pm

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.


Posts

Joined
Thu Jul 28, 2011 10:33 pm

Post by sparkdigital » Sun Aug 14, 2011 3:12 am

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

Newbie

Posts

Joined
Sat Aug 13, 2011 10:39 pm

Post by redvangang » Mon Aug 15, 2011 12:25 am

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.

Newbie

Posts

Joined
Mon Aug 15, 2011 12:18 am

Post by vintagetractors » Wed Aug 17, 2011 6:30 pm

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.
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!

Thanks


Posts

Joined
Thu Jul 28, 2011 10:33 pm

Post by redvangang » Mon Aug 22, 2011 3:58 pm

vintagetractors wrote:
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.
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!

Thanks
Hi vintagetractors
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.

Newbie

Posts

Joined
Mon Aug 15, 2011 12:18 am

Post by vintagetractors » Thu Aug 25, 2011 9:31 pm

redvangang wrote:
vintagetractors wrote:
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.
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!

Thanks
Hi vintagetractors
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,
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.


Posts

Joined
Thu Jul 28, 2011 10:33 pm
Who is online

Users browsing this forum: No registered users and 43 guests