Ecommerce software home
Shopping Cart Software Forum for Ecommerce Templates
 
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

Find us on Facebook Follow us on Twitter View our YouTube channel
Search our site
Forum Search
Google Site Search
 All Forums
 Technical
 PHP (Unix / Linux / Apache) versions
 Redirect category to product
Author « Topic »  

Fingertech
Advanced Member

Canada
318 Posts

Pre-sales questions only
(More Details...)

Posted - 12/06/2020 :  22:46:55  
Is it possible to add a redirect into htaccess so that anyone clicking into:
"[url]https://www.fingertechrobotics.com/products.php?cat=Playable+Battle+Robot+Kits[/url]"
(which can be found in the category "[url]https://www.fingertechrobotics.com/categories.php?cat=Kits+%26+Parts[/url]")
links straight to the only product in the category:
"[url]https://www.fingertechrobotics.com/proddetail.php?prod=PBRK[/url]"

Thanks in advance!

Vince
Administrator

42703 Posts

Posted - 12/07/2020 :  02:35:26  
How about something like...

RewriteCond %{QUERY_STRING} ^prod=Playable%20Battle%20Robot%20Kits$
RewriteRule ^products\.php$ /proddetail.php?prod=PBRK

Vince

Click Here for Shopping Cart Software
Click Here to sign up for our newsletter
Click Here for the latest updater

Fingertech
Advanced Member

Canada
318 Posts

Pre-sales questions only
(More Details...)

Posted - 12/07/2020 :  08:39:12  
Have I put it in the right place? Hasn't worked here, or with it at the very bottom.

[code]
Options +FollowSymlinks -Multiviews -Indexes
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{QUERY_STRING} ^prod=Playable%20Battle%20Robot%20Kits$
RewriteRule ^products\.php$ /proddetail.php?prod=PBRK
RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
RewriteRule ^category/([^/.]*)/?$ /categories.php?cat=$1 [QSA,nc,L,B]
RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
RewriteRule ^products/([^/.]*)/?$ /products.php?cat=$1 [QSA,nc,L,B]
RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
RewriteRule ^manufacturer/([^/.]*)/?$ /manufacturer.php?man=$1 [QSA,nc,L,B]
RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
RewriteRule ^([^/.]+)$ proddetail.php?prod=$1 [QSA,nc,L,B]
</IfModule>

## EXPIRES CACHING ##
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/gif "access 1 year"
ExpiresByType image/png "access 1 year"
ExpiresByType text/html "access plus 1 seconds"
</IfModule>
## EXPIRES CACHING ##

## BEGIN Cache-Control Headers
<ifModule mod_headers.c>
Header set X-XSS-Protection "1; mode=block"
Header always append X-Frame-Options SAMEORIGIN
Header set X-Content-Type-Options nosniff
<filesMatch "\.(ico|jpe?g|png|gif|swf)$">
Header set Cache-Control "public"
</filesMatch>
</ifModule>
## END Cache-Control Headers
RewriteCond %{HTTP_HOST} ^fingertechrobotics\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.fingertechrobotics\.com$
RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
RewriteRule ^(.*)$ "https\:\/\/www\.fingertechrobotics\.com\/$1" [R=301,L]
RewriteCond %{HTTP_HOST} ^fingertechrobotics\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.fingertechrobotics\.com$
RewriteRule ^\/products\.php\?cat\=Playable\+Battle\+Robot\+Kits$ "https\:\/\/www\.fingertechrobotics\.com\/proddetail\.php\?prod\=PBRK" [R=301,L]
[/code]

Vince
Administrator

42703 Posts

Posted - 12/08/2020 :  00:48:18  
I just tried it on your site and it worked for me.
It could be you are seeing a cached version of the page. Can you try in a new browser window?

Vince

Click Here for Shopping Cart Software
Click Here to sign up for our newsletter
Click Here for the latest updater

Fingertech
Advanced Member

Canada
318 Posts

Pre-sales questions only
(More Details...)

Posted - 12/08/2020 :  13:32:50  
I've tried on a new browser, cleared cache in both, had two other people try it, but they don't get redirected. You're sure when you click on [url]https://www.fingertechrobotics.com/products.php?cat=Playable%20Battle%20Robot%20Kits[/url] it takes you to [url]https://www.fingertechrobotics.com/proddetail.php?prod=PBRK[/url] with no subcategory?

1818charlie
ECT Moderator

United Kingdom
1192 Posts

Posted - 12/08/2020 :  15:20:36  
Hi

Visiting that first URL then clicking on the product Playable Battle Robot Kit definitely
goes to https://www.fingertechrobotics.com/proddetail.php?prod=PBRK

Steve
Egerton Village, Bolton, UK

Edited by - 1818charlie on 12/08/2020 15:23:13

Fingertech
Advanced Member

Canada
318 Posts

Pre-sales questions only
(More Details...)

Posted - 12/08/2020 :  17:05:06  
1818charlie - Right, so it isn't redirecting anything. You are getting to the category as normal, when I want people to be directed straight to the product.

midvalleydrifter001
Ecommerce Template Expert

USA
931 Posts

Posted - 12/08/2020 :  20:42:23  
Maybe try it this way in this format.

RewriteCond %{QUERY_STRING} ^cat\=Playable\+Battle\+Robot\+Kits$
RewriteRule ^products\.php$ https://www.fingertechrobotics.com/proddetail.php?prod=PBRK [R=301,L]


You will need to delete this one:

RewriteRule ^\/products\.php\?cat\=Playable\+Battle\+Robot\+Kits$ "https\:\/\/www\.fingertechrobotics\.com\/proddetail\.php\?prod\=PBRK" [R=301,L]

Edited by - midvalleydrifter001 on 12/08/2020 20:44:32

Fingertech
Advanced Member

Canada
318 Posts

Pre-sales questions only
(More Details...)

Posted - 12/09/2020 :  10:44:57  
That's done it! Thank you!

midvalleydrifter001
Ecommerce Template Expert

USA
931 Posts

Posted - 12/09/2020 :  14:02:58  
Glad I was able to help.

Patrick
  « Topic »  
Jump To:
Shopping Cart Software Forum for Ecommerce Templates © 2002-2022 ecommercetemplates.com
This page was generated in 0.02 seconds. Snitz Forums 2000