Questions tagged [redirection]

Redirection in Drupal means sending the users to a different page.

-1
votes
1answer
13 views

Redirect domain to www, but on subdomain do not use www

I have a multilanguage website. The main language is English and the second language is Spanish. I need to have all the traffic using this domains: English domain: www.example.com Spanish domain: es....
0
votes
0answers
13 views

When using /user/login as the default 403 access denied page, how can I add the tabs block to the login form?

After removing the anonymous permission to view published content, and setting the 403 access denied page to /user/login, the tabs block is no longer shown with the user login form. The tabs block ...
0
votes
0answers
29 views

User not logged in

I have a Drupal 8 installation and it is not logging in the users. Tried Google search and applied all solutions like setting cookie_domain, trusted_host_patterns and clearing cache. Note that, if ...
0
votes
1answer
28 views

Redirect user after one-time-login

When users get an email with one time login link, they will arrive on a page to set their password (separated form via Password Separate Form) But once they click submit, it doesn't redirect them to ...
0
votes
0answers
58 views

How to stop a local database from launching the online website?

I'm a designer and new to Drupal. been studying for a couple of months creating sites for personal learning. I started working in a company that had a Drupal 7 website. I studied, learned it and ...
-1
votes
1answer
25 views

How to make redirect in jQuery callback function? [duplicate]

When I use this $form_state->setResponse(new TrustedRedirectResponse($url, 302)); in submitForm() it works fine. But when I try to use it in jQuery callback function it doesn't redirect me. How to ...
0
votes
1answer
17 views

Redirecting old file URLs (no pattern)

running Drupal 7.65. Our previous website manager moved us from Drupal 6 to Drupal 7 and cleaned up the file structure on our server. While all the files that are now on our website have clean and ...
-2
votes
2answers
74 views

How do I redirect a user to the front page after logging in? [closed]

Is there a way to redirect users to the front page after they log in, without using any additional modules other than the core modules. Right now they are redirected to their profiles.
0
votes
1answer
12 views

LDAP SSO does not authenticate user on homepage

I have configured ldap sso and it is working so far for all Url paths except for the homepage. I get authenticated on /user/login/sso and I get authenticated on /whatsoever but I don't get ...
0
votes
0answers
18 views

Non secure links redirect to homepage rather than serving over HTTPS

I have a site that is forcing HTTPS so that any links get redirected to being loaded securely if they aren't already so. For the most part, this works but there are a few links that work fine when ...
0
votes
0answers
21 views

Rules 301 redirect?

I have a rule which checks for URL segment and redirects to homepage. It works good but redirect is 302, not 301. Is it possible to use somehow 301 redirect or that can be achieved only via .htaccess?...
0
votes
0answers
46 views

How to redirect to the previous page after submission of a form in a block

I have a view of nodes of type task. I created a block with an inline task create form (using form block module) The block is next to the view on the same page. Question: After creating a new task by ...
0
votes
0answers
18 views

Execute some “code” when an external link is clicked

I'm very new to Drupal 8 and would really appreciate any advice about the best way to tackle my problem. I am creating an online video catalog that indexes videos from external vendors. All the videos ...
2
votes
1answer
75 views

Disabling Page Cache for Redirect Response

I've implemented a conditional redirect on my site via an event subscriber and returning a redirect response. It's working but, I believe due to the page_cache module is getting cached for anonymous ...
1
vote
0answers
18 views

404 not re-directing. Error: Call to a member function isSuccessful() on null

Having an issue with Drupal 8 not re-directing to our 404 page. The screen displays the ubiquitous "The website encountered an unexpected error. Please try again later." When I look in the recent ...
0
votes
0answers
15 views

Redirect old URL to new URL via htaccess with path

I am using HTTPS and WWW only rules in Drupal 7's .htaccess like: RewriteCond %{HTTP_HOST} !^www\. [NC] RewriteRule ^ https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301] # ensure https RewriteCond %{...
0
votes
1answer
45 views

How to use a RedirectResponse with a # (hash)?

I have this code: $event->setResponse(new RedirectResponse(base_path().'mypage#actions_clicker')); It redirects to /mypage, but it doesn not include the #actions_clicker part. How do I make ...
0
votes
0answers
31 views

id 'Redirect::create' status code optional?

I have a landing page generated from a social media account, at the landing page page 1 a backend decision is made, if a specific cookie is found they are taken to page 2, if it is not found they are ...
0
votes
1answer
40 views

Redirecting to a page based on the sub-domain

How can I redirect visitors to a specific page based on the sub-domain? For example: www.site.com goes to frontpage checklist.site.com goes to checklist.site.com/checklist My server is set to work ...
3
votes
1answer
133 views

How do I avoid caching a redirect response from a form?

I have a Drupal 8 form used by authenticated users which sometimes needs to redirect based on the presence of absence of something in session. I don't want the redirect to be cached. My form is ...
-1
votes
1answer
33 views

Getting redirect to phantom page /user/register/thankyou

In Drupal 8, I created a page with the path alias /user/register/thankyou to redirect users to after registration. Later, I changed the url of this page to simply be /register/user/thankyou. I have ...
1
vote
1answer
34 views

Links in stage environments are absolute and send users to live enviroment

This problem has been driving crazy for years. whenever I create a stage environment of a site, I copy the database from the production site. some of the links there - whether in the menus or in the ...
1
vote
0answers
20 views

Multiple sites in same subfolder

I have multiple very similar drupal sites (each for a specific year of some project): 2012.somain.tld, 2013.domain.tld, etc. Their files are organized in subdirectories (2012, 2013, etc.) of ...
0
votes
0answers
87 views

Is there a way to open redirected links in new tab?

I am using redirect module from my Drupal 8 website to some external website. Is there a way to force to open the redirected links in new tab?
0
votes
0answers
26 views

language redirect need more restricted control

I installed my drupal site with default English language. Then I added French language and change the default language to French, the original path following the domain thus append a parent path of /...
0
votes
1answer
26 views

What is the best way to forward visitors to my homepage to an external site but leave the backlinks accessible?

Maybe not distinctly a Drupal question, I have an older Drupal 7 site that I want to leave up for backlinks, but any new visitors I want to redirect to a new external website. So domain.com would ...
0
votes
1answer
70 views

Redirect to a specific page in ajax callback

How can I redirect to a specific page in an ajax callback using Drupal 7, I've already tested this method: function my_ajax_callback($form, &$form_state) { if (!user_is_anonymous()) { ...
2
votes
1answer
111 views

How to dynamically redirect user from /foo/X to /bar/X?

So far I did the following: I've installed Redirect and Token modules. I've applied the patch for Redirect module to support wildcards. I've applied the patch for Redirect module to implement ...
1
vote
1answer
101 views

How to find where are defined tokens for Redirect?

After enabling Token and Redirect modules, I've found at /admin/help/token that I can use Redirect tokens. For example: However, I've got the problem finding the place where and how these tokens are ...
2
votes
2answers
37 views

How do I display an error message on a basic page when the user does not have permissions to see the nested view inside the basic page?

I have a basic page, and inside of that basic page I have a view "newsletters". The view "newsletters" has permissions set on it based on role, so only admin and subscribers can see it. How can I ...
1
vote
3answers
574 views

How to do a redirect in node.html.twig?

I'm trying to do a redirect on my node.html.twig template based on the content type because I'm using views for my content. I tried this: {% do redirect('/example') %} or this: {% redirect '/...
0
votes
1answer
71 views

Error is raised when I try to redirect webform submission to external webpage with query string

Dear Drupal community, I created a webform using the webforms module in Drupal 8 in order to add information to a webpage. Since I don't want to update the webpage manually I'd like to automatize ...
1
vote
1answer
30 views

Alter menu link if logged in

I have a regular node in my main menu that: if an anonymous user clicks on it, the node should be shown regularly if a logged in user clicks on it, there should be a redirect to an external website ...
3
votes
1answer
542 views

How to redirect user page to front page for specific roles

I want to redirect every users page to front page? like if user page url is /user/97 then it redirect to front page if user is not administrator. I want user page inaccessible to other users but only ...
0
votes
1answer
92 views

How can I build a redirect from submitted form values?

I'm working on a short weather app. What I want to do, is to catch name of the input of city and redirect users to the city's page URL after submit. function form_findYourCity_submit($form, &$...
0
votes
1answer
120 views

Remove index.php from imported urls

I made some migration of pretty old website to d8. And urls ported fine from latest WP version: /user1/article-name1 /user2/2009/article-about-something /user3/2017/11/06/article-something But from ...
-2
votes
1answer
156 views

Redirect users to home page if already logged in

I am using a third party authentication mechanism to authenticate users. On successful authentication, I am able to redirect the users to the front page using the RedirectResponse class. If logged-in ...
1
vote
1answer
377 views

Customize “Access Denied” (403) page for specific content type [closed]

I'm currently setting up a simple LMS in Drupal 8 and would like to customize the Access Denied page as follows: Anonymous users should be redirected to the Login page, when they hit a 403 error. ...
0
votes
2answers
214 views

How to disable redirection to the node after node form submission

I have a node form exposed in the front-end to allow visitors to add their organisation to the list of partners. Below the form, I have exposed view block with the list of existing partners. When a ...
2
votes
4answers
371 views

How do I redirect after saving the user account with $user->save()?

How can I redirect users in a custom module after saving a user account with $user->save()? It always goes to the user profile after saving and I want to redirect to a custom page. function ...
1
vote
1answer
49 views

Redirect user on specified route

I know we can easily redirect a path to another path with Redirect module, but what I want to do is more complicated, my condition is when the user has a specified IP and the route is matched with to ...
0
votes
3answers
1k views

How to redirect from URL with trailing slash to one without

We are using the Redirect module 8.x-1.2 with Drupal 8.5.6. When generating URLs, we are finding that a trailing slash is added to the end of the URL, and this is creating a 503 error code. How ...
0
votes
1answer
182 views

Problem with programmatically creating a redirect

Background Client has Event webforms hosted externally by a marketing automation service, leading to an unusual situation: a node of Event content type should have its summary displayed in certain ...
1
vote
1answer
64 views

How to redirect all variations of a domain to https version? [duplicate]

Google has started punishing non https sites both in SEO and their browsers. So I guess we must make sure that all our clients are using https Assuming that I have a domain example.com I would like ...
2
votes
2answers
61 views

Force redirect back to password form until password got set after one-time-login

When my users click on a one-time-password-reset link then I log them in and then show them a page where they can choose their new password. Problem is that there are two additional links on that page ...
0
votes
1answer
40 views

Prevent access to or redirect /user page

I'm looking to redirect or prevent access for authenticated users to the /user page. The reason being that it serves no purpose being there so would like to either remove or redirect it. The best I'...
0
votes
0answers
55 views

Set dynamic $base_url with Domain Access module to avoid redirects

If you run two URLs with Domain module like e.g. main.site.com sub.site.com main.site.com is main site, so if you go to sub.site.com/user and login, it redirects back to main.site.com. This happens ...
0
votes
1answer
168 views

Redirect after updating nodes [duplicate]

I've to redirect users, after updating a node, to /node/NID path and not to /node/NID/latest (I'm using content moderation). I've tried to add this on hook_node_update() but have been ignored (...
1
vote
0answers
38 views

Some URLs need a trailing slash or it redirects to the home page

I have cloned my production site to a dev environment. Both are Drupal 7.58 running on a WIMP stack if that matters. Both are using clean URLs. In the dev site this url http://mysite/about-us ...
0
votes
1answer
76 views

Redirect for anonymus user doesn´t work from Controller

Community, i´ve got a simple COntroller for redirect my users by visiting a special path (localhost/drupal8/check). At the moment the redirect works for the administrator and for registrated user, if ...