8 – How to redirect after node insertion (not form redirection)?

I am trying to figure out how to redirect after inserting a new node. All the answers I've been able to find discuss $ form_state-> setRedirectUrl (); but this is a form redirect; it is not a proper redirect after insert.

The difference is that when I submit the node form; I use hook_node_insert to create another entity based on the information of the node being inserted. After inserting the main node; I want to redirect to a path based on the entity ID of the new child entity.

In hook_node_insert (for the parent; that is, submitting the original form) I set a drupal_register_shutdown_function function that correctly saves my child entity and then I have the -> id () of the new (child) entity.

I have seen several examples using RedirectResponse, like this:

$redirect = new RedirectResponse(Url::fromUserInput('/admin/commerce/orders/' . $order->id() . '/payments')->toString());;
$redirect->send();

but none of these works.

Bank redirection fails because Chrome loses session cookie

I am managing multiple eCommerce websites, all are personalized and all accept credit card payments via bank redirection (website redirects customer to bank checkout page, bank redirects customer back to site later the payment has been processed).

Once Chrome 80 launched, I noticed a common trend among all eCommerce websites, when user has paid and is redirected from bank to ecommerce site, all session cookies are missing. Therefore, the customer is not recognized as the customer who initiated the payment.

I will try to illustrate the problem:

  • example.tld: user receives a session cookie
  • example.tld – User logs in with a valid email address
  • example.tld: user places an order
  • example.tld: redirects the user to mybank.tld
  • mybank.tld – the user enters the details of cc, the payment was successful
  • mybank.tld – redirect user to example.tld
  • example.tld: unknown user, no cookies! redirect user to error page

This problem ONLY occurs with Chrome 80, all other browsers work fine (Firefox, Safari, Edge, mobile browsers like Samsung Internet, etc.). Earlier versions of Chrome also work fine (<= 79).

This issue occurs on ALL eCommerce websites that I manage, the only consistent among them is Chrome 80.

Of course, all e-commerce sites are PCI certified, use TLSv1.2, and the session cookie is defined with the "domain", "secure" (true), and "httpOnly" (true) parameters set. Expires is set to "Session".

Is this a new security feature that deletes all current sessions / cookies when Chrome detects visits to a bank?

Has anyone seen this problem before?

Thank you.

subdomain – Subdomain redirection issues (NEW)

When I use a subdomain it redirects to my default page / domain. This only happens when using HTTPS … for example

https://forums.raiderzmc.net – takes me to raiderzmc.net … BUT
http://bans.raiderzmc.net – takes me to the prohibition website (the correct site)

I am using Apache 2 and Ubuntu 18.04 using my own VPS. ((I also have 2 more subdomains registered in the domain, but I think it may be a problem with one of my Apache settings!)) Or a Cloudflare problem.

## ENABLED SITES CONFIGURE ##

RewriteEngine on
RewriteCond% {SERVER_NAME} = bans.raiderzmc.net (OR)
RewriteCond% {SERVER_NAME} = status.raiderzmc.net (OR)
RewriteCond% {SERVER_NAME} = raiderzmc.net (OR)
RewriteCond% {SERVER_NAME} = forums.raiderzmc.net
RewriteRule ^ https: //% {SERVER_NAME}% {REQUEST_URI} (END, NE, R = permanent)

DocumentRoot /var/www/html/raiderzmc.net/
ServerName raiderzmc.net


    Options +Indexes +FollowSymLinks +MultiViews +Includes
    AllowOverride FileInfo Options
    Order allow,deny
    allow from all

RewriteEngine on
RewriteCond% {SERVER_NAME} = raiderzmc.net
RewriteRule ^ https: //% {SERVER_NAME}% {REQUEST_URI} (END, NE, R = permanent)

DocumentRoot /var/www/html/bans.raiderzmc.net/
ServerName bans.raiderzmc.net


    Options +Indexes +FollowSymLinks +MultiViews +Includes
    AllowOverride FileInfo Options
    Order allow,deny
    allow from all

RewriteEngine on
RewriteCond% {SERVER_NAME} = raiderzmc.net (OR)
RewriteCond% {SERVER_NAME} = bans.raiderzmc.net (OR)
RewriteCond% {SERVER_NAME} = forums.raiderzmc.net
RewriteRule ^ https: //% {SERVER_NAME}% {REQUEST_URI} (END, NE, R = permanent)

## SSL CONFIGURATION WITHIN THE ENABLED SITES ##

DocumentRoot /var/www/html/raiderzmc.net/
ServerName raiderzmc.net


    Options +Indexes +FollowSymLinks +MultiViews +Includes
    AllowOverride FileInfo Options
    Order allow,deny
    allow from all

Include /etc/letsencrypt/options-ssl-apache.conf
ServerAlias ​​forum.raiderzmc.net
ServerAlias ​​bans.raiderzmc.net
ServerAlias ​​status.raiderzmc.net
SSLCertificateFile /etc/letsencrypt/live/bans.raiderzmc.net-0001/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/bans.raiderzmc.net-0001/privkey.pem

DocumentRoot /var/www/html/forums.raiderzmc.net/
ServerName forums.raiderzmc.net


    Options +Indexes +FollowSymLinks +MultiViews +Includes
    AllowOverride FileInfo Options
    Order allow,deny
    allow from all

DocumentRoot /var/www/html/bans.raiderzmc.net/
ServerName bans.raiderzmc.net


    Options +Indexes +FollowSymLinks +MultiViews +Includes
    AllowOverride FileInfo Options
    Order allow,deny
    allow from all

apache: help with 301 redirection of subdomain to root domain

To redirect requests from sub.example.com/uri to example.com/uri:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^sub.example.com$
RewriteRule ^(.*)$ http://example.com/$1 (R=301,L)

To redirect requests from sub.example.com/uri to example.com:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^sub.example.com$
RewriteRule ^(.*)$ http://example.com/ (R=301,L)

I need to apply a paging redirection in htacess

My blog is creating duplicate pagination and Google understands this as duplicate content.
How to redirect pagination 301 as in the example below, to the correct one?

example: https://oarthur.com/page/33? page = 34
to: https://oarthur.com/page/33
https://oarthur.com/page/23? page = 25
to: https://oarthur.com/page/23

I need to redirect everything ? page = to your correct link / number

Recently, could I remove broken links? M = 0 with:

RewriteCond% {QUERY_STRING} ^ m = (01) $
RewriteRule (. *) / $ 1? (R = 301, L)

Thank you.
(sorry my English, I use the Google translator).

magento2: Magento redirection to the control panel when saving in the back-end, lost changes

I have an intermittent problem that seems to happen in all the Magento 2 sites that I manage, if I work in the backend and save something (it could be a block of content, category, product, etc.), from time to time the time I It will redirect to the control panel and I will lose all the work I was saving. This happens to me almost once a day, and often happens shortly after logging in, so I don't know how it could be related to cookies (since our cookie life is set to one hour). Has anyone else encountered this problem? As you can imagine, it is terribly frustrating, and it reached the point where I select and copy all the content I have edited before clicking Save to be able to paste it, if the save action does not work.

Any suggestions on what to look at?

Lifetime video redirection to your URL on a high quality adult tube site with 180k PV / day

Summary traffic is 2.46 million sessions per month (82 thousand sessions per day or 898 million sessions per year). This domain is over 6 years old. As of January 1, 2020, the Alexa rank is 39xxx. 178k page views per day.

Session duration: 02:22 minutes; 2.12 page views per session, and bounce rate – 60.94%
SEMrush

86.2 percent of visits to this site come from a search engine, while 8.1% comes directly and 5.6% through a hyperlink somewhere on the Internet.

Most sessions start from Italy – 89.4%, France – 1.7%, United States of America – 1.7%, Germany – 1.7%, Belgium – 0.7%

I will publish the thumbnail of your video in 2 categories where they will remain throughout the life of the site. You should give me an ITALIAN translation of the name and description of your thumb. The relevant video offers for the thumb work best. Once the user CLICK on the thumbnail, it will be REDIRECTED to its offer page. The thumbnail you provide must be relevant for each category chosen.

I cannot guarantee the amount of TRAFFIC you will receive and I cannot provide you with an accurate estimate. From 100 unique to 4000 unique per month for life!

All this for the special introductory price of $ 35 subject to change soon.

Contact me for the URL.

(IMG) "data-url =" https://i.ibb.co/wWpvHB2/2.png

(IMG) "data-url =" https://i.ibb.co/pwmKTCJ/3.png

(IMG) "data-url =" https://i.ibb.co/n8jP5qj/4.png

7 – How to configure a message after a particular page redirection using the page manager?

After certain fields have been configured in the node editing form and saved, I do not want the node author to change them further and, therefore, I have created a new variant with a response code "301 permanent redirection"in the Page Manager.

My redirect destination is set to %node:url?destination=no-edit-permission
And redirects the author to the desired node view (node_view in the Page Manager).
But the reason I set this up is to be able to display a message at the top of that redirected page that says "You can no longer edit this page".
So how do I configure a message of this type based on the destination in the URL?

redirection – Drupal 8 – https with and without www at the base

I have implemented the website based on drupal 8.

global $ base_url; It is used in two different modules.

Module 1:

$content .= $base_url .'/user/role/1';

gives url pattern as:
https://www.example.com/user/role/1

Module 2:

$content .= $base_url .'/services';
gives url pattern as:
https://example.com/services

Is there any configuration or configuration that needs to be configured to get the same pattern when I call $ base_url?

Run a java program from a shell script with redirection

I have a java program (Main.java, uandf.java and node.java), where the Main program takes the contents of an input file and does things. For my task, I have to write a shell script that compiles and runs the program, but the input file must be redirected to the shell script: that is, shell_script.sh <file.

Is there any way for the contents of the file to be passed to the java program as a command line argument?

What I have so far:

#!/usr/bin/bash

javac -O Main.java uandf.java node.java
java -cp Main "$1"

I am running the script with ./shell_script.sh < filename