Jump to content

Recommended Posts

For few products groups I've prepared a presentation page, and would like to redirect corresponding menu items of the "store" menu, to this page.

I.e., I would like that "SSL certificates" menu item, which point to /cart.php?gid=7 , would be inted redirected to /ssl-certificates.php

Tried with following statement in .htaccess:

Redirect 301 /cart.php?gid=7 /ssl-certificates.php

... but it doesn't work... 😞

Any idea?

Share this post


Link to post
Share on other sites

Could you try placing it on top of your .htaccess?

Share this post


Link to post
Share on other sites
16 hours ago, Remitur said:

Any idea?

technically, i'm still on holiday (just started) but had to login to answer a few urgent PMs, so while i'm here... 🏖️

16 hours ago, Remitur said:

For few products groups I've prepared a presentation page, and would like to redirect corresponding menu items of the "store" menu, to this page.

i'd have said just to use a hook to change the links for these specific groups - the hook I posted in the thread below will do that, you'll just have to change the group names you want to redirect, and the file/url to redirect them to...

and now i'll disappear again into the ether... 🍦

Share this post


Link to post
Share on other sites
6 hours ago, Kian said:

Could you try placing it on top of your .htaccess?

I tried... nothing change.
I guess it may be related to the php parameter ?gid=7 ...
Would need to deeper test it to understand how it can works.

4 hours ago, brian! said:

 

i'd have said just to use a hook to change the links for these specific groups - the hook I posted in the thread below will do that, you'll just have to change the group names you want to redirect, and the file/url to redirect them to...

Great!!! Your hook works fine!!!!

 

Share this post


Link to post
Share on other sites
Posted (edited)

Ouch... I forgot that Redirect 301 doesn't work with query string. You can redirect old.php to new.php but old.php?bla=true will never match anything. For this kind of stuff you need to use RewriteRule. The rule below should work (my htaccess skills are poor 😑).

RewriteEngine On
RewriteCond %{REQUEST_URI} ^/cart.php$
RewriteCond %{QUERY_STRING} ^gid=7$
RewriteRule ^ ssl-certificates.php [R=301,L]

 

Edited by Kian

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated