Regex expression for URL redirection plugin? - regex

I'm looking for the right regex expression to use on a redirection plugin.
Here is our current set up:
We're looking to make it so that when someone completes a survey they are taken to a thank you page, but when they have only been linked to the page they are redirected to the survey. At first I realized that we couldn't simply have the links between the two pages since the redirect was actually coming from jotforms. I'm not sure what's wrong in my regex expression that won't let it through, though! That said, it worked on a mobile phone.
Additionally, it would be nice to be able to allow any links from our domain. I add | for or between the rules, right? And how do you make it match anything on the domain?
Thanks for your help!
edit I now realize that one issue was that I called it a permanent redirect instead of a temporary redirect which was causing issues with a browser that had already seen the redirect and stored it as permanent.

Related

How to make google analytics track only domain without subomains?

I have two websites:
site.com
sub.site.com
First one has google analytics and the cookies have this domain: ".site.com". What happens is that my second site get these cookies posted which is not connected at all and I don't want that. Is there a way to achieve this? I think that changing ".site.com" domain, to "site.com" will work, but I am not 100% sure nor do I know how to do this with google analytics either.
There is actually an answer in another question, that is not the accepted one though.
We need to add this to the GA code:
pageTracker._setDomainName("none")
This will set the cookie domain to "site.com" instead of ".site.com" and it will not be posted to subdomains.

HTML - Storing Data (Cookies)

So I've recently made this Website and they wanted a message at the top of the Website to let everyone know they were still updating the Website and should expect changes to the site. Although I made this message whenever anyone closes the message and then refreshes the page the message pops back up and I don't want this to happen.
How do I go about storing their IP Address so when they close the message it never re-appears.
I couldn't find the answer anywhere but if it has already been asked if you could point me in the direction of the answer that would be great. Thanks :)
As far as I know, there isn't a way to do that with just HTML.
The way I would tackle it is to use simple JavaScript to store/check for a cookie and display/hide a message respectively.
the cookie is part of the document object in JavaScript, if you're not familiar with JavaScript, or just looking for some explanations then feel free to Google "JavaScript Cookies" or check this link for a simple tutorial from w3schools.
Also, just to explain why I would choose cookies over storing IP addresses, this approach (cookies) does the job on the front-end, which transfers the overhead into the client's machine. While storing IP addresses (or tackling the problem in a similar manner) requires a server-side solution, which means slighlty more things for your server to do, and a lot more for you to do (You'll need to code that in PHP or so in order to implement it on the back-end).
I hope my answer get you on the right track.
Good luck with your project.
P.S some countries' regulations require you to display a disclaimer of some sort just to let the customer know that "Our website uses Cookies to store information on your device", make sure you cover that base in case you go for Cookies.

Cookie not kept when moving from html to perl page

One of my clients uses Sellerdeck as their shopping cart solution. I am currently implementing a service for them that relies heavily on cookies.
The cookie is set on a product page which has a URI that is something like http://www.mydomain.co.uk/retail/acatalog/A11-Insect-Net.html. When I browse around the site, I can see the cookie set on all pages, like it is supposed to.
Then when I go into the checkout process, Sellerdeck apparently starts using perl, because the URI changes to something like http://www.mydomain.co.uk/cgi-bin/retail/ca001000.pl. The weird thing is that, although we're still on the same domain, I can't see the cookie. When I go back to the product pages it is there again.
Doe anyone know why this may be?
Turns out the cookie was tied to a specific path and not to /. Fixed now.

Clear cookies for a website using parameters appended to a URL

I have searched to find a way that I can clear cookies from a browser for a specific site just by appending parameters to an end of a URL. I assume that if this even existed it would be browser dependent. Due to not finding anything within a 30 minute search, I assume that this doesn't exist for any browser. I hope that
It is an odd situation why I need this. I use BigCommerce, and I need to clear out everything from my cart. I spent yesterday afternoon trying to find a BigCommerce arguement that allowed for this. After talking with support, they don't have a clearCart function that other shopping cart platforms has. They only have a clear item function/parameter that you can append to the end of a URL.
If I could clear all the cookies created by my site by a user clicking on a link, it would clear the contents of the cart. I have tried to hack the clear item parameters, but never could find a way to clear all items.
The clear item URL is like this: mysite.com/cart.php?action=remove&item=52fa8fd1e398b
Speaking generally first, no - there is no part of specification or browser implementations that supports arbitrarily clearing all cookies from a particular domain through the use of http GET parameters. This would be a horrible security hole if it did exist in either specification or practice. If it was possible, I could maliciously redirect your browser to some known site and destroy information that you did not want destroyed.
Now to your particular situation ... I gather that what you want to do is not so much clear the cookies from your own browser in this particular site, but rather, you are trying to implement a "clear cart" button on your own BigCommerce site. Is that right?
If so, cookies is probably not the path forward that you are seeking. I don't think BigCommerce exposes shopping cart functions through their api. But I would be interested to hear from the BigCommerce folks on that.
Your best bet to add a "clear cart" function is to add javascript to the page that iterates all cart items and makes that http call you mentioned. If you do this, make sure to have some graceful fallback for the case where they change the uri. :)

Facebook Send Button: 'Sorry, something went wrong'

I'm implementing a Facebook Send dialog, by opening facebook.com/dialog/send in a popup window. When I click the 'Send' button the dialog will display the error: 'Sorry, something went wrong' – but only for certain link URLs. The best examples I have are:
Not Working:
https://www.facebook.com/dialog/send
?app_id=12345
&name=Example
&link=facebook.com/examplepage
&redirect_uri=http://www.example.com/response
Working:
https://www.facebook.com/dialog/send
?app_id=12345
&name=Example
&link=google.com
&redirect_uri=http://www.example.com/response
These links are identical except that the first one shares 'facebook.com' and the second one shares 'google.com'. Only the second one works.
The same errors occur if I use the Facebook JavaScript API with FB.ui({method: 'send'}).
Answering my own question:
Both the links now work for me, although I have not changed anything. I can only hypothesise that Facebook has either fixed this bug, or this issue occurs on some internet connections and not others.
I think Facebook is trying to read the URL and pre-populate the image and content. In your case probably because skiggle.com.au is a redirected to the other domain and facebook doesn't accept it.
Edit. Your first link works though
I had the same problem & worked out that this was due to linking to a Facebook page that did not have a vanity URL set up (i.e. http://www.facebook.com/CubicMushroom rather than http://www.facebook.com/profile.php?id=261963707177053). If you set up a vanity URL for the page it seems to work OK (providing you link to the vanity URL version of the page URL).
To claim a vanity URL, once you have a certain no of like (it used to be 25, but think it's a little lower now) visit https://www.facebook.com/username/
This can also happen if you share a link to localhost