Jump to content

page redirecting


Remitur

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?

Link to comment
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... 🍦

Link to comment
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!!!!

 

Link to comment
Share on other sites

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
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

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