Forum Moderators: phranque

Message Too Old, No Replies

Forward all cart links to maint page

How to forward my cart links to a maintenance page

         

1611mac

2:34 pm on Jan 10, 2015 (gmt 0)

10+ Year Member



I need to temporarily redirect all my 3rd party cart links to a maint page.

I have site: www.mysite.com
My cart links are: www.thecart.com/SecureCart/SecureCarrt.aspx?userid&productid

Obviously the userid and productid vary.

How do I direct all my www.thecart.com/ links to a www.mysite/maint.html page on my site?

I know how to do individual page redirects but not "global" external url redirects...

Thanks

lammert

7:38 pm on Jan 10, 2015 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Hi 1611mac,

I expect the domain thecart.com to be not under your control because you mentioned that it is a 3rd party cart provider. In that case you cannot add some magic code to your .htaccess file to redirect those links to a page on your site. The only thing you can do is change your site's source code, but that may be a significant amount of work.

1611mac

7:43 pm on Jan 10, 2015 (gmt 0)

10+ Year Member



Ok. Thanks for the reply.I appreciate your taking the time to answer.

lucy24

10:22 pm on Jan 10, 2015 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Incidentally...
Obviously the userid and productid vary.

That wouldn't matter. By default, a redirect (whether by mod_alias or mod_rewrite) looks only at the "path" part of the URL. In fact, you'd need extra code if you did need to consider the query (either its exact content or the mere fact that it exists).

lammert-- even if the cart is third-party, wouldn't requests start out on your own site? Then all you'd need to do is intercept requests before they are passed along to whoever administers the cart.

lammert

10:32 pm on Jan 10, 2015 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



lammert-- even if the cart is third-party, wouldn't requests start out on your own site? Then all you'd need to do is intercept requests before they are passed along to whoever administers the cart.

Depends on the cart. If it is an external API with only http calls, you're out of luck and have to modify each individual query in your source. But if the cart is using a locally installed front end, you can intercept these calls probably more easily. But both systems require intervention at the script level (PHP or whatever) rather than on Apache's level IMHO.