Guest Posted June 15, 2004 Share Posted June 15, 2004 support thread for this contribution http://www.oscommerce.com/community/contributions,2183 Nimmit :) Quote Link to comment Share on other sites More sharing options...
Farrukh Posted June 16, 2004 Share Posted June 16, 2004 Works excellently Thanks for one of the most important Contribution to OsC so far. Quote Link to comment Share on other sites More sharing options...
Guest Posted June 17, 2004 Share Posted June 17, 2004 Nimmit, Looks great can't wait to install it! Just wondering though does this contribution re-write the image urls as well. If so can this feature be disabled? Thanks, Edwin Quote Link to comment Share on other sites More sharing options...
Guest Posted June 17, 2004 Share Posted June 17, 2004 No it shouldn't do - just the links ;) Quote Link to comment Share on other sites More sharing options...
Guest Posted June 17, 2004 Share Posted June 17, 2004 ok looking at your website in a bit more detailed showed that it actually does change the image links too. looking at your source code it shows the image location as: <IMG height=100 alt="" src="Golddigga Scoop Top Charcole - Freeriderstores Tops Department ( Golddigga Scoop Top in charcole ) -_files/thundercats_g_1_2999.jpg" width=100 border=0> So it looks like it does. This is probably not good for one big reason... it increaeses page load time because images can not be cached locally. Not to mention it means that contributions that use image locations wont work. Any ideas about how we could disable the image urls from being re-written? Quote Link to comment Share on other sites More sharing options...
Guest Posted June 17, 2004 Share Posted June 17, 2004 I don't know what source your looking at ? When I look it has the following ... <img src="images/product_imgs/alphabet/thundercats_g_1_2999.jpg" border="0" alt="Thunder Cats T-Shirt" title=" Thunder Cats T-Shirt " width="100" height="100"> You seem to have part of my page titles in the code you posted ?? have another look :D The code that you posted wouldn't display an image at all ! im telling you - it does not rewrite the image urls - in only rewrites <a href 's have a look at the code of url_rewrite This is the bit that does the rewriting ... $pagecontent = preg_replace_callback("/(<[Aa][ \r\n\t]{1}[^>]*href[^=]*=[ '\"\n\r\t]*)([^ \"'>\r\n\t#]+)([^>]*>)/",'wrap_href',$pagecontent); The same as silencers Sam Quote Link to comment Share on other sites More sharing options...
Farrukh Posted June 19, 2004 Share Posted June 19, 2004 I found one problem with it All the links worked but the links in the Review Section did not work and returned a Bad Request Error. Quote Link to comment Share on other sites More sharing options...
Guest Posted June 19, 2004 Share Posted June 19, 2004 Thank you Farrukh !! Fixed now - version V0.2 avalible in the contributions section http://www.oscommerce.com/community/contributions,2183 If you just want to upgrade only url_rewrite.php was changed - any probs let me know ! Sam Quote Link to comment Share on other sites More sharing options...
Farrukh Posted June 19, 2004 Share Posted June 19, 2004 (edited) There was an error in the installation file. #-----> NIMMIT:SEF:B require(DIR_WS_INCLUDES . 'nimmit_sef.php') #-----> NIMMIT:SEF:E changed to #-----> NIMMIT:SEF:B require(DIR_WS_INCLUDES . 'nimmit_sef.php'); #-----> NIMMIT:SEF:E I have also uploaded the entire mod. Edited June 19, 2004 by Farrukh Quote Link to comment Share on other sites More sharing options...
Farrukh Posted June 19, 2004 Share Posted June 19, 2004 There was an error in the installation file. #-----> NIMMIT:SEF:B require(DIR_WS_INCLUDES . 'nimmit_sef.php') #-----> NIMMIT:SEF:E changed to [/code] #-----> NIMMIT:SEF:B require(DIR_WS_INCLUDES . ' Quote Link to comment Share on other sites More sharing options...
Guest Posted June 19, 2004 Share Posted June 19, 2004 Cool thanks ! Was it just the ; at the end of the line ? Quote Link to comment Share on other sites More sharing options...
Farrukh Posted June 19, 2004 Share Posted June 19, 2004 Yes, it was only the ; at the end of the line. Quote Link to comment Share on other sites More sharing options...
Guest Posted June 20, 2004 Share Posted June 20, 2004 Hi, Thanks for the contirbution, looks very slick. I was trying to install it earlier, and everything appeared to be fine, all files in pace and modifications made, but upon completing the install i receive a 'Forbidden' page (in both the store side and the admin side of the site), if i remove the changes to .htaccess everything goes back to working fine. I have double checked and mod_rewrite is definatly installed, SEF links are off and gzip is also off. The only thing i can think off is that my catalog side is installed in the root (not /catalog/). Any ideas would be much appreciated. Cheers Matt Quote Link to comment Share on other sites More sharing options...
Guest Posted June 20, 2004 Share Posted June 20, 2004 Mine is installed in the root as well ?It shouldn't matter where you install it really. I think that it must have something todo with your host - have you used .htaccess/mod_rewrite on your server before ? Interesting - let me know sam Quote Link to comment Share on other sites More sharing options...
Guest Posted June 20, 2004 Share Posted June 20, 2004 (edited) I just installed the SEF Link Transformer mod to check, and this mod works just fine. So i would assume mod-rewrite is working. I will try a re-install of your mod, just incase. Any other pointers you may be able to think of would be great. Cheers Matt P.S. just by adding: RewriteEngine on RewriteBase / to .htaccess it gives me the forbidden error on all pages Edited June 20, 2004 by consoleplus Quote Link to comment Share on other sites More sharing options...
Chris Dunning Posted June 21, 2004 Share Posted June 21, 2004 This is a great mod! I'm trying to improve it a wee bit. When you see a list of products with more than one page, clicking on the links for next/previous pages shows a url like this: www.yoursite.com/category/categoryname.html?sort=1a&page=2 I'd like to rewrite that to be something like this: www.yoursite.com/category/categoryname/sort/1a/page/2.html I've managed to accomplish changing the URL in url_rewrite.php, but I haven't had any luck with the .htaccess file to change it back to the format that osCommerce needs. Here are the rewrite rules I'm using, can anyone tell me where I've gone wrong? #rewrite for multiple page categories RewriteRule ^/?(category)/(.*)/(page)/(.*)/(sort)/([^/]*)\.html$ index.php?cPath=$2&page=$4&sort=$6%{QUERY_STRING} [NC] #rewrite for multiple page manufacturers RewriteRule ^/?(brand)/(.*)/(page)/(.*)/(sort)/([^/]*)\.html$ index.php?cPath=$2&page=$4&sort=$6%{QUERY_STRING} [NC] Anyone? Quote Chris Dunning osCommerce, Contributions Moderator Team Please do not send me PM! I do not read or answer these often. Use the email button instead! I do NOT support contributions other than my own. Emails asking for support on other people's contributions will be ignored. Ask in the forum or contact the contribution author directly. Link to comment Share on other sites More sharing options...
Guest Posted June 22, 2004 Share Posted June 22, 2004 the first thing that i notice about your rewrite is you have them in the page and sort in the wrong order.- Original www.yoursite.com/category/categoryname/sort/1a/page/2.html yours RewriteRule ^/?(category)/(.*)/(page)/(.*)/(sort)/([^/]*)\.html$ index.php?cPath=$2&page=$4&sort=$6%{QUERY_STRING} [NC] Sugestion RewriteRule ^/?category/(.*)/sort/(.*)/page/([^/]*)\.html$ index.php?cPath=$1&page=$3&sort=$2%{QUERY_STRING} [NC] you have to be quite carful - if you have a local instalation ? Remember the rewrite log directive in .htconf RewriteLog /path/filename.ext RewriteLogLevel 3 I'm going on holiday today so i won't be able to see the result of this one for a while. Good luck sam Quote Link to comment Share on other sites More sharing options...
frank1002us Posted June 22, 2004 Share Posted June 22, 2004 (edited) i have tried using this contributtion but nothing happends i have checked in the server info and it seems that rewrite mod is installed Loaded Modules mod_gzip, mod_auth_passthrough, mod_log_bytes, mod_bwlimited, mod_php4, mod_frontpage, mod_ssl, mod_setenvif, mod_so, mod_auth, mod_access, mod_rewrite, mod_alias, mod_userdir, mod_actions, mod_imap, mod_asis, mod_cgi, mod_dir, mod_autoindex, mod_include, mod_status, mod_negotiation, mod_mime, mod_log_config, mod_env, http_coreis this what i am looking for and if it is what i am looking for and if it is why it is not working Edited June 22, 2004 by frank1002us Quote Link to comment Share on other sites More sharing options...
cuauhtli Posted June 23, 2004 Share Posted June 23, 2004 (edited) I can't make it work. I found a couple of problems: 1) It looks like the store has to be installed in root, since all my links now point to: www.mystore.com/product/product123.html , www.mystore.com/shipping.html instead of www.mystore.com/catalog/product/product123.html , www.mystore.com/catalog/shipping.php 2) My store is in spanish, and this contribution uses the product names in english. So it's no use to me, but I'll try to mod it so it works in spanish. 3) I had trouble editing the .htaccess file. The rewrite rules are VERY long, so if you have word wrap enabled while editting it won't work. Maybe this is why some people are having problems. Anyway, I think this is a much needed contribution. Thank you nimmit! Edited June 23, 2004 by cuauhtli Quote Link to comment Share on other sites More sharing options...
cuauhtli Posted June 23, 2004 Share Posted June 23, 2004 I tried the contrib on a store installed on root instead of on /catalog and this contrib worked OK, with restrictions. I found a problem when trying to change languages: all the flags are redirected to the same page, but sorted differently. For example: http://www.mystore.com/category/Books.html?sort=2a Most users only have one language installed, but is necessary for others. :) Quote Link to comment Share on other sites More sharing options...
Guest Posted June 23, 2004 Share Posted June 23, 2004 I still can't seem to get this one to work, i always get 'Forbidden' error apages throughout the site as soon as the .htaccess is modified or even replaced with the once in the contribution (i tried this after reading aboe regarding the word wrap etc.). As i am getting a forbidden error page i assume this problem must be some way related to the .htaccess - i can use other mods that inolve mod_rewrite just fine, no errors at all. I will let you know if i manage to sort it :) Cheers Matt Quote Link to comment Share on other sites More sharing options...
Guest Posted June 25, 2004 Share Posted June 25, 2004 I currently have SEF Link Transformer (SE friendly URLs): http://www.oscommerce.com/forums/index.php?act=ST&f=7&t=50336 Installed but would be keen to upgrade to this SEF solution. I was just wondering if I leave the current re-write rules in my .htaccess file and add the new rules will that allow my old urls (created by SEF Link Transformer) to continue functioning. I am not an expert of re-write rules so don't really have a clue and don't want to break my store. Any help would be greatly appreciated. Cheers, Edwin Quote Link to comment Share on other sites More sharing options...
John Doswell Posted June 30, 2004 Share Posted June 30, 2004 hi there, i have installed it and it works but ony on my first page, if i remove RewriteEngine on RewriteBase / since i have seen someone reinstalling osc in to the root and it worked for him i would think by changing RewriteEngine on RewriteBase / to something like RewriteEngine on RewriteBase /mydirectory/ should do, but that dont help :( is there any other way i can maybe change the working directory? untill then Forbidden You don't have permission to access /mydirectory/ on this server. -------------------------------------------------------------------------------- Apache/1.3.19 Server at www.robinsonstestserver.cz Port 80 :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( Quote Link to comment Share on other sites More sharing options...
John Doswell Posted June 30, 2004 Share Posted June 30, 2004 (edited) ok, first part sorted. if i change function callback($pagecontent) { ?$pagecontent = preg_replace_callback("/(<[Aa][ \r\n\t]{1}[^>]*href[^=]*=[ '\"\n\r\t]*)([^ \"'>\r\n\t#]+)([^>]*>)/",'wrap_href',$pagecontent); ?return $pagecontent; to function callback($pagecontent) { $pagecontent = preg_replace_callback("/mydirectory(<[Aa][ \r\n\t]{1}[^>]*href[^=]*=[ '\"\n\r\t]*)([^ \"'>\r\n\t#]+)([^>]*>)/",'wrap_href',$pagecontent); return $pagecontent; it works with no errors, but i cant add # -----> NIMMIT:SEF:B RewriteEngine on RewriteBase / #-----> single file no vars RewriteRule ^([^/]*)\.html$ $1.php?%{QUERY_STRING} [NC] #-----> one var RewriteRule ^/?(product)/([^/]*)\.html$ product_info.php?products_id=$2&%{QUERY_STRING} [NC] RewriteRule ^/?(category)/([^/]*)\.html$ index.php?cPath=$2&%{QUERY_STRING} [NC] RewriteRule ^/?(brand)/([^/]*)\.html$ index.php?manufacturers_id=$2&%{QUERY_STRING} [NC] #-----> two vars RewriteRule ^/?(category)/(.*)/(product)/([^/]*)\.html$ product_info.php?cPath=$2&products_id=$4&%{QUERY_STRING} [NC] RewriteRule ^/?(brand)/(.*)/(product)/([^/]*)\.html$ product_info.php?manufacturers_id=$2&products_id=$4&%{QUERY_STRING} [NC] #-----> Reviews RewriteRule ^/?(product_reviews_write|product_reviews|product_reviews_info)/product/([^/]*)\.html$ $1.php?products_id=$2&%{QUERY_STRING} [NC] RewriteRule ^/?(product_reviews_write|product_reviews|product_reviews_info)/category/(.*)/product/([^/]*)\.html$ $1.php?cPath=$2&products_id=$3&%{QUERY_STRING} [NC] RewriteRule ^/?(product_reviews_write|product_reviews|product_reviews_info)/brand/(.*)/product/([^/]*)\.html$ $1.php?manufacturers_id=$2&products_id=$3&%{QUERY_STRING} [NC] #-----> products new RewriteRule ^/?(products_new)/product/([^/]*)\.html$ $1.php?products_id=$2&%{QUERY_STRING} [NC] # -----> NIMMIT:SEF:E to my .htaccess file then i get forbidden :-( john Edited June 30, 2004 by RobinsonDixon Quote Link to comment Share on other sites More sharing options...
Farrukh Posted June 30, 2004 Share Posted June 30, 2004 Nimmit, There is one more bug. Its with the Reviews. When you click on a particular review, it does not show that review rather it shows all the reviews. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.