Author
Message
bdmdesign Worker Joined: May 11, 2009 Posts: 151 Location: Winsen/Luhe; Germany
Posted:
Mon Nov 09, 2009 4:30 pm
Ok i have made a GT File like this:
Code:
$urlin = array(
'"(?<!/)modules.php\?name=catalog&file=product_reviews_info&products_id=([0-9+]*)&reviews_id=([0-9+]*)"',
'"(?<!/)modules.php\?name=catalog&file=product_reviews_write&products_id=([0-9+]*)"',
'"(?<!/)modules.php\?name=catalog&file=product_reviews&products_id=([0-9+]*)"',
'"(?<!/)modules.php\?name=catalog&file=reviews"',
'"(?<!/)modules.php\?name=catalog&file=tell_a_friend&products_id=([0-9+]*)"',
'"(?<!/)modules.php\?name=catalog&file=products_new&page=([0-9+]*)"',
'"(?<!/)modules.php\?name=catalog&file=products_new"',
'"(?<!/)modules.php\?name=catalog&file=product_info&products_id=([0-9+]*)&action=add_product"',
'"(?<!/)modules.php\?name=catalog&file=product_info&products_id=([0-9+]*)"',
'"(?<!/)modules.php\?name=catalog&file=specials"',
'"(?<!/)modules.php\?name=catalog&file=impressum"',
'"(?<!/)modules.php\?name=catalog&file=faq"',
'"(?<!/)modules.php\?name=catalog&file=conditions"',
'"(?<!/)modules.php\?name=catalog&file=privacy"',
'"(?<!/)modules.php\?name=catalog&file=shipping"',
'"(?<!/)modules.php\?name=catalog&file=checkout_success"',
'"(?<!/)modules.php\?name=catalog&file=checkout_confirmation"',
'"(?<!/)modules.php\?name=catalog&file=checkout_payment"',
'"(?<!/)modules.php\?name=catalog&file=checkout_shipping"',
'"(?<!/)modules.php\?name=catalog&file=shopping_cart&sort=([0-9+a-zA-Z]*)"',
'"(?<!/)modules.php\?name=catalog&file=shopping_cart"',
'"(?<!/)modules.php\?name=catalog&file=address_book_process&edit=([0-9+]*)"',
'"(?<!/)modules.php\?name=catalog&file=address_book_process"',
'"(?<!/)modules.php\?name=catalog&file=address_book"',
'"(?<!/)modules.php\?name=catalog&file=account_notifications"',
'"(?<!/)modules.php\?name=catalog&file=account_newsletters"',
'"(?<!/)modules.php\?name=catalog&file=account_edit"',
'"(?<!/)modules.php\?name=catalog&file=account_history_info&order_id=([0-9+]*)"',
'"(?<!/)modules.php\?name=catalog&file=account_history_info&([0-9+]*)=([0-9+]*)"',
'"(?<!/)modules.php\?name=catalog&file=account_history"',
'"(?<!/)modules.php\?name=catalog&file=account"',
'"(?<!/)modules.php\?name=catalog&file=index&manufacturers_id=([0-9+]*)"',
'"(?<!/)modules.php\?name=catalog&file=index&cPath=([0-9+]*)_([0-9+]*)"',
'"(?<!/)modules.php\?name=catalog&file=index&cPath=([0-9+]*)"',
'"(?<!/)modules.php\?name=catalog&file=index"',
'"(?<!/)modules.php\?name=catalog"'
);
$urlout = array(
'catalog-file-product_reviews_info-products_id-\\1-reviews_id-\\2.html',
'catalog-file-product_reviews_write-products_id-\\1.html',
'catalog-file-product_reviews-products_id-\\1.html',
'catalog-file-reviews.html',
'catalog-file-tell_a_friend-\\1.html',
'catalog-file-products_new-page-\\1.html',
'catalog-file-products_new.html',
'catalog-file-product_info-\\1-add_product.html',
'catalog-file-product_info-\\1.html',
'catalog-file-specials.html',
'catalog-file-impressum.html',
'catalog-file-faq.html',
'catalog-file-conditions.html',
'catalog-file-privacy.html',
'catalog-file-shipping.html',
'catalog-file-checkout_success.html',
'catalog-file-checkout_confirmation.html',
'catalog-file-checkout_payment.html',
'catalog-file-checkout_shipping.html',
'catalog-file-shopping_cart-sort-\\1.html',
'catalog-file-shopping_cart.html',
'catalog-file-address_book_process-edit-\\1.html',
'catalog-file-address_book_process.html',
'catalog-file-address_book.html',
'catalog-file-account_notifications.html',
'catalog-file-account_newsletters.html',
'catalog-file-account_edit.html',
'catalog-file-account_history_info-order_id-\\1.html',
'catalog-file-account_history_info-\\1-\\2.html',
'catalog-file-account_history.html',
'catalog-file-account.html',
'catalog-file-manufacturers_id-\\1.html',
'catalog-cPath-\\1_\\2.html',
'catalog-cPath-\\1.html',
'catalog.html',
'catalog.html'
In .htacces:
Code:
RewriteRule ^catalog-file-product_reviews_info-products_id-([0-9+]*)-reviews_id-([0-9+]*).html modules.php?name=catalog&file=product_reviews_info&products_id=$1&reviews_id=$2 [L]
RewriteRule ^catalog-file-product_reviews_write-products_id-([0-9+]*).html modules.php?name=catalog&file=product_reviews_write&products_id=$1 [L]
RewriteRule ^catalog-file-product_reviews-products_id-([0-9+]*).html modules.php?name=catalog&file=product_reviews&products_id=$1 [L]
RewriteRule ^catalog-file-reviews.html modules.php?name=catalog&file=reviews [L]
RewriteRule ^catalog-file-tell_a_friend-([0-9+]*).html modules.php?name=catalog&file=tell_a_friend&products_id=$1 [L]
RewriteRule ^catalog-file-products_new-page-([0-9+]*).html modules.php?name=catalog&file=products_new&page=$1 [L]
RewriteRule ^catalog-file-products_new.html modules.php?name=catalog&file=products_new [L]
RewriteRule ^catalog-file-product_info-([0-9+]*)-add_product.html modules.php?name=catalog&file=product_info&products_id=$1&action=add_product [L]
RewriteRule ^catalog-file-product_info-([0-9+]*).html modules.php?name=catalog&file=product_info&products_id=$1 [L]
RewriteRule ^catalog-file-specials.html modules.php?name=catalog&file=specials [L]
RewriteRule ^catalog-file-impressum.html modules.php?name=catalog&file=impressum [L]
RewriteRule ^catalog-file-faq.html modules.php?name=catalog&file=faq [L]
RewriteRule ^catalog-file-conditions.html modules.php?name=catalog&file=conditions [L]
RewriteRule ^catalog-file-privacy.html modules.php?name=catalog&file=privacy [L]
RewriteRule ^catalog-file-shipping.html modules.php?name=catalog&file=shipping [L]
RewriteRule ^catalog-file-checkout_success.html modules.php?name=catalog&file=checkout_success [L]
RewriteRule ^catalog-file-checkout_confirmation.html modules.php?name=catalog&file=checkout_confirmation [L]
RewriteRule ^catalog-file-checkout_payment.html modules.php?name=catalog&file=checkout_payment [L]
RewriteRule ^catalog-file-checkout_shipping.html modules.php?name=catalog&file=checkout_shipping [L]
RewriteRule ^catalog-file-shopping_cart-sort-([0-9+a-zA-Z]*).html modules.php?name=catalog&file=shopping_cart&sort=$1 [L]
RewriteRule ^catalog-file-shopping_cart.html modules.php?name=catalog&file=shopping_cart [L]
RewriteRule ^catalog-file-address_book_process-edit-([0-9+]*).html modules.php?name=catalog&file=address_book_process&edit=$1 [L]
RewriteRule ^catalog-file-address_book_process.html modules.php?name=catalog&file=address_book_process [L]
RewriteRule ^catalog-file-address_book.html modules.php?name=catalog&file=address_book [L]
RewriteRule ^catalog-file-account_notifications.html modules.php?name=catalog&file=account_notifications [L]
RewriteRule ^catalog-file-account_newsletters.html modules.php?name=catalog&file=account_newsletters [L]
RewriteRule ^catalog-file-account_edit.html modules.php?name=catalog&file=account_edit [L]
RewriteRule ^catalog-file-account_history_info-order_id-([0-9+]*).html modules.php?name=catalog&file=account_history_info&order_id=$1 [L]
RewriteRule ^catalog-file-account_history_info-([0-9+]*)-([0-9+]*).html modules.php?name=catalog&file=account_history_info&$1=$2 [L]
RewriteRule ^catalog-file-account_history.html modules.php?name=catalog&file=account_history [L]
RewriteRule ^catalog-file-account.html modules.php?name=catalog&file=account [L]
RewriteRule ^catalog-file-manufacturers_id-([0-9+]*).html modules.php?name=catalog&file=index&manufacturers_id=$1 [L]
RewriteRule ^catalog-cPath-([0-9+]*)_([0-9+]*).html modules.php?name=catalog&file=index&cPath=$1_$2 [L]
RewriteRule ^catalog-cPath-([0-9+]*).html modules.php?name=catalog&file=index&cPath=$1 [L]
RewriteRule ^catalog.html modules.php?name=catalog&file=index [L]
RewriteRule ^catalog.html modules.php?name=catalog [L]
now i go over the menue Block in the Catalog, the "modules?name=catalog" was rewriten to catalog.html, but not the rest.
What is wrong ?
Best Regards
Peter
Last edited by bdmdesign on Tue Nov 10, 2009 10:49 am; edited 1 time in total
spasticdonkey RavenNuke(tm) Development Team Joined: Dec 02, 2006 Posts: 1252 Location: Texas, USA
Posted:
Mon Nov 09, 2009 4:51 pm
you need a GTB file that corresponds to the block.
for the quick and easy open your GT-YourModuleName.php and save as:
GTB-block-BlockFileNameHere.php
you can remove any rewrites in the GTB file that aren't used within the block.... if you like
meotoo Hangin' Around Joined: Aug 04, 2009 Posts: 36
Posted:
Mon Nov 09, 2009 5:11 pm
Hi,
1) You need to escape . and = characters in your urlin array.
2) You have to replace & by & in your .htaccess rules.
hope that helps.
bdmdesign Worker Joined: May 11, 2009 Posts: 151 Location: Winsen/Luhe; Germany
Posted:
Mon Nov 09, 2009 5:29 pm
spasticdonkey wrote: you need a GTB file that corresponds to the block.
for the quick and easy open your GT-YourModuleName.php and save as:
GTB-block-BlockFileNameHere.php
you can remove any rewrites in the GTB file that aren't used within the block.... if you like
Ok, but the blockfiles are coming later.
Its at this time only a problem with the catalog modules.
Ok i try the &, replaceing.
Edit: @meotoo:
In all other GT-Modules Files its the same code:
'"(?<!/)modules.php\?name=Forums&file=viewtopic&t=([0-9]*)&start=([0-9]*)"',
I have copy the GT-Downloads.php and change it to the catalog syntax (see my first post). The File called GT-catalog.php
Edit End
Best Regards
Peter
meotoo Hangin' Around Joined: Aug 04, 2009 Posts: 36
Posted:
Mon Nov 09, 2009 5:48 pm
Quote: In all other GT-Modules Files its the same code
It does not mean it isn't wrong
run the following under php and you'll notice it for yourself:
echo preg_quote('modules.php?foo=bar');
Palbin Site Admin Joined: Mar 30, 2006 Posts: 2404 Location: Pennsylvania
Posted:
Mon Nov 09, 2009 6:25 pm
meotoo wrote: Hi,
1) You need to escape . and = characters in your urlin array.
2) You have to replace & by & in your .htaccess rules.
hope that helps.
That is incorrect.
Palbin Site Admin Joined: Mar 30, 2006 Posts: 2404 Location: Pennsylvania
Posted:
Mon Nov 09, 2009 6:35 pm
I am not a regex expert but I think most of your "[0-9+]*" should be "[0-9]*".
bdmdesign Worker Joined: May 11, 2009 Posts: 151 Location: Winsen/Luhe; Germany
Posted:
Mon Nov 09, 2009 6:36 pm
Must i added some thing in the modules index ?
Or in the .htacces in the catalog?
Its my first time to write SEO Urls.
Give it a universal Rules for Short URL ?
Sorry for all my ask.
Best Regards
Peter
Palbin Site Admin Joined: Mar 30, 2006 Posts: 2404 Location: Pennsylvania
Posted:
Mon Nov 09, 2009 6:44 pm
Sorry bdmdesign, but I am having a hard time understanding exactly what you are saying.
If you want a "universal" tap to work across the site you need to add it to the GTZ-PageTap.php.
If that is not what you needed sorry again.
bdmdesign Worker Joined: May 11, 2009 Posts: 151 Location: Winsen/Luhe; Germany
Posted:
Mon Nov 09, 2009 6:45 pm
Palbin wrote: I am not a regex expert but I think most of your "[0-9+]*" should be "[0-9]*".
Hmmm, but Rules without [0-9+]* dosnt works.
Its works only one Rule
Best Regards
Peter
bdmdesign Worker Joined: May 11, 2009 Posts: 151 Location: Winsen/Luhe; Germany
Posted:
Mon Nov 09, 2009 6:53 pm
Palbin wrote: Sorry bdmdesign, but I am having a hard time understanding exactly what you are saying.
If you want a "universal" tap to work across the site you need to add it to the GTZ-PageTap.php.
If that is not what you needed sorry again.
No, its ok. I mean a Universal Rule for all new Modules.
I will try it. But its must works with the GT-My_Modules.php, too.
And sorry for my hard English, its only school english.
I can speak better German than english
Best Regards
Peter
meotoo Hangin' Around Joined: Aug 04, 2009 Posts: 36
Posted:
Mon Nov 09, 2009 7:30 pm
Palbin wrote: meotoo wrote: Hi,
1) You need to escape . and = characters in your urlin array.
2) You have to replace & by & in your .htaccess rules.
hope that helps.
That is incorrect.
pardon?
which point? or do you mean both!?
I have to admit point (1) is strictly talking, it should (obviously) work without escaping them, but i'm following strict PHP rules
Seriously, if the dot isn't escaped, it will convert in the same way modules.php than modulesZphp - since as you should know a dot means "any character" in regexp.
Regarding point (2), i have no doubt... it is buggy to write urls in your browser's location bar in the form: yoursite.com/blabla.php?foo=bar&home=house
because your scripts will see it as
_GET['foo'] = 'bar';
_GET['amp;home'] = 'house';
or that i noticed, at least...
bdmdesign Worker Joined: May 11, 2009 Posts: 151 Location: Winsen/Luhe; Germany
Posted:
Mon Nov 09, 2009 7:48 pm
meotoo wrote: Palbin wrote: meotoo wrote: Hi,
1) You need to escape . and = characters in your urlin array.
2) You have to replace & by & in your .htaccess rules.
hope that helps.
That is incorrect.
pardon?
which point? or do you mean both!?
I have to admit point (1) is strictly talking, it should (obviously) work without escaping them, but i'm following strict PHP rules
Seriously, if the dot isn't escaped, it will convert in the same way modules.php than modulesZphp - since as you should know a dot means "any character" in regexp.
Regarding point (2), i have no doubt... it is buggy to write urls in your browser's location bar in the form: yoursite.com/blabla.php?foo=bar&home=house
because your scripts will see it as
_GET['foo'] = 'bar';
_GET['amp;home'] = 'house';
or that i noticed, at least...
The second part is ok, that was my mistake. All other rules in the htacces are with "&" and not with"&"
But it dosnt works
Best Regards
Peter
bdmdesign Worker Joined: May 11, 2009 Posts: 151 Location: Winsen/Luhe; Germany
Posted:
Mon Nov 09, 2009 7:53 pm
But now i go sleep.
Best Regards
Peter
montego Former Admin in Good Standing Joined: Aug 29, 2004 Posts: 9071 Location: Arizona
Posted:
Tue Nov 10, 2009 6:52 am
bdmdesign , there has been a bunch of discussion here that I am concerned we are not tracking any longer to the real problem. For one, ([0-9+]*) is absolutely not correct unless your ID's being tapped also include the "+" sign in them which I highly doubt. This should be ([0-9]*) throughout GT and .htaccess.
In your original posting, you mentioned no issues with the module taps at all, it was with some kind of block. Is this a block that is configured via the ACP --> Blocks administration tool or something embedded within the module?
It would really help everyone help you if we could actually see the issue you are referring to.
bdmdesign Worker Joined: May 11, 2009 Posts: 151 Location: Winsen/Luhe; Germany
Posted:
Tue Nov 10, 2009 8:45 am
montego wrote: bdmdesign , there has been a bunch of discussion here that I am concerned we are not tracking any longer to the real problem. For one, ([0-9+]*) is absolutely not correct unless your ID's being tapped also include the "+" sign in them which I highly doubt. This should be ([0-9]*) throughout GT and .htaccess.
In your original posting, you mentioned no issues with the module taps at all, it was with some kind of block. Is this a block that is configured via the ACP --> Blocks administration tool or something embedded within the module?
It would really help everyone help you if we could actually see the issue you are referring to.
Ok, i have made the file GT-catalog.php for the modules catalog (osc2nuke, osc-Cart4nuke, etc ....)
The Blockfiles i dont have createt, because i will test the modules first without the block's rewrite.
I have change the ([0-9+]*) to ([0-9]*), ((?<!/) to (?!/) only in the GT file) and "&" to "&" in the GT-catalog and htacces.
Now i get this URL's:
"catalog.html&file=products_new"
I have try this, too:
Its the same.
Best Regards
Peter
Thanx @ll for Help Brothers
meotoo Hangin' Around Joined: Aug 04, 2009 Posts: 36
Posted:
Tue Nov 10, 2009 9:02 am
nice you followed the tips i told you by PM
Quote: I have try this, too:
Its the same. Shocked Rolling Eyes Laughing
This fixed function IS ONLY/MAINLY to perform the links's ampersands conversion on a safe way - read, only over links and NOT over the whole HTML code
bdmdesign Worker Joined: May 11, 2009 Posts: 151 Location: Winsen/Luhe; Germany
Posted:
Tue Nov 10, 2009 9:05 am
Thanx @ll for Help again Brothers.
I have configure the right things out now. Its works now.
The "&" to "&" in the GT File dont was a good idea
Edit:
Not 100% correct, if i go on Home in the Navi/Menue Block, the URLs are Nuke URLs. If i click now on "osc-Cart4nuke 0.0.1" in the Menue Block, the URLs are rewriten.
Edit End
Best Regards
Peter
bdmdesign Worker Joined: May 11, 2009 Posts: 151 Location: Winsen/Luhe; Germany
Posted:
Tue Nov 10, 2009 9:37 am
Ok now its works 100% Correct.
Best Regards
Peter
bdmdesign Worker Joined: May 11, 2009 Posts: 151 Location: Winsen/Luhe; Germany
Posted:
Tue Nov 10, 2009 10:48 am
You can Download now the Short Links for your osc Nuke Modules on .
Have Fun.
Best Regards
Peter
montego Former Admin in Good Standing Joined: Aug 29, 2004 Posts: 9071 Location: Arizona
Posted:
Wed Nov 11, 2009 11:57 am
bdmdesign , your web server is not configured properly to download a .7z file. You might either want to fix the mime/application handlers or try .zip.
bdmdesign Worker Joined: May 11, 2009 Posts: 151 Location: Winsen/Luhe; Germany
Posted:
Wed Nov 11, 2009 12:09 pm
Ok, i have try it to get a File: Opera and Konqueror works right and Firefox not ?!?
Can you test it with IE, too please?
Best regards
Peter
montego Former Admin in Good Standing Joined: Aug 29, 2004 Posts: 9071 Location: Arizona
Posted:
Wed Nov 11, 2009 12:37 pm
Just tested using IE8 and it does download. So, yes, it might be FF3.0.x which is what i have on this PC.
bdmdesign Worker Joined: May 11, 2009 Posts: 151 Location: Winsen/Luhe; Germany
Posted:
Wed Nov 11, 2009 1:03 pm
montego wrote: Just tested using IE8 and it does download. So, yes, it might be FF3.0.x which is what i have on this PC.
Yes dito, its a FF 3.0.x bug.
Best Regards
Peter
View next topic
View previous topic
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum