Questions tagged [redirection]

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

Filter by
Sorted by
Tagged with
-1 votes
1 answer
54 views

How do I add path exception in Redirect and Fast 404 modules?

I have a module which has dynamic paths (e.g. /mymodule/one/file1/a.png, /mymodule/one/two/three, /mymodule/one/two/three/four/b.js), where the number of path parameters are resolved by a class ...
1 vote
3 answers
920 views

How to implement a button with different redirections?

I'm setting up a job directory using Drupal 8, together with a team. It is possible to see it here. As you can see below, in a screenshot of the site, there's a button called "Add new job": In a ...
0 votes
1 answer
249 views

How to add redirect section to node edit on Drupal 8?

On Drupal7 using Redirect module there was a section on node/nodeid/edit view where we could add a "Redirect" section. This was helpful because it allowed redirects to be created from the node/nodeid/...
  • 2,596
1 vote
3 answers
903 views

views intergration with redirect module

I've googled and nothing found about redirect module integration into views to add new filter criteria for a content type or taxonomy. I need all redirects (FROM and To fields that showing in the ...
0 votes
1 answer
271 views

Redirection after adding new groups and gnodes using group module

I am using Group module and Drupal 8. After adding a new group, the page will be redirected to the corresponding group page(ie. /group/5) but I want to change it to be the group edit page (ie. /group/...
-2 votes
1 answer
32 views

How to properly redirect users to their own pages from 404 or 404 error pages

Instead of using one of multiple contributed modules, which deal with redirections from error pages, I'd like to simply redirect users from the pages with other users uids in the path they tried to ...
  • 347
-1 votes
1 answer
211 views

Access to folder files without redirect to drupal index [duplicate]

I need to access a folder of my project. My project is at the root of my domain, and it is a Drupal (so the .htaccess redirects all traffic to the Drupal index.php). I need to access my resource /...
  • 111
0 votes
0 answers
487 views

How do I create a path alias and redirect node?

I want to create a path alias pattern like [base_url][title] and overwrite the existing path alias for a specific content type. Also, all the nodes are redirected to the new custom alias. e.g., ...
  • 450
1 vote
2 answers
1k views

Default Redirect after login based on destination

I have custom routing and a user controller in a module that redirects authenticated users to a private area on a site. It works fine when users are coming from the login page - redirects them to a ...
  • 1,221
-1 votes
2 answers
287 views

URL for authenticated user edit own webform submission

I have checked the "authenticated user" option in "content">"nameOfMyWebform">"Webform"(tab)>"Form settings">"Submission access">"Roles that can submit this webform". My problem is that I don't know ...
0 votes
1 answer
47 views

Rule + redirect

I want all my anonymous users to be redirected to a specific page. I created a rule for this : https://imgur.com/mUl8H9Q It works, all anonymous are redirected to the page "espace press" and they can ...
  • 71
1 vote
2 answers
1k views

Redirect to 404 page, if the path alias doesn't exist

I am developing a multilingual site in Drupal 8. I added content in Turkish and I didn't create any translation for that node. I managed to redirect user to the path alias. For example, when users ...
  • 165
0 votes
1 answer
336 views

How do I redirect a node to a path followed by a wildcard?

I have a basic page node that contains two views in block form. The views both contain contextual filters captured from the URL. How to I publish my node to allow the user to visit /report/2002, or /...
1 vote
1 answer
438 views

How to create a rule to perform a redirect if user is already logged in and visits the homepage?

I have a Drupal 7 installation. In my homepage I have only two forms (login and register) so I need when someone leaves the site and the user is logged in, when he visits it again that he redirect to ...
1 vote
0 answers
489 views

D8: How to get destination without compromising TrustedRedirectResponse?

I have following code in my controller for route: \Drupal::destination()->get(); return new TrustedRedirectResponse('http://www.google.com'); Which results in error: LogicException: The ...
  • 111
0 votes
2 answers
119 views

If a user does not have a role, keep redirecting them to the same form until they complete it?

I have a form/node that I want all users to complete after logging in for the first time. When the user completes the form (saves the node), they are automatically awarded the completed role. If a ...
1 vote
2 answers
3k views

How to redirect programatically using a route with parameters?

I am trying to use the Passwordless module API to redirect the user on login. I want to redirect the user to a specific node edit page (node/12/edit). In hook_passwordless_login_redirect(), the ...
-2 votes
2 answers
71 views

How do I redirect a specific page on my drupal site to an external site?

I have a shop on my drupal website which we have replaced with an updated squarespace page. I need the drupal page to automatically redirect to the new shop and I can only find a help page from circa ...
0 votes
1 answer
113 views

How to update the URL Redirect module v1.4 to its latest version without losing redirects?

When I last went to update the URL redirect module from 8.x-1.4 to its latest version I saw this note: After 8.x-1.4 version URL Redirect changed as config entity. If you are using before 8.x-1.4 ...
0 votes
2 answers
192 views

How to redirect anonymous user to 404 instead of 403?

I'm new to Drupal so am struggling here. I've created a checkbox field and the goals is that when it is checked it redirects anonymous to the 404 page. I have the following condition: function ...
-1 votes
1 answer
299 views

User Redirection based on his status (loggedin/loggedout)

So as the title dictates, I'm trying to redirect the user based on his status but I'm facing difficulty in doing so. Here is what i'm doing: In the submit form: public  function submitForm(array &...
2 votes
2 answers
600 views

How do I redirect users after they submit a form?

How do I redirect users after they submit a form? I tried the following code, but it doesn't work. It says the route doesn't exist. public  function submitForm(array &$form, FormStateInterface $...
1 vote
2 answers
1k views

Redirect After User Registration if Referred from Specific URL

I have been trying to redirect users after filling out the user registration if referred from a specific page on the site with form_alter like so function custom_markup_form_alter(&$form, &$...
  • 235
4 votes
1 answer
354 views

Different front page depending on previous selection for anonymous users

I have a D8 project where the client wants users to select a route they will follow depending on who they are (let's call the two groups Students and Employers), and then the next time they visit show ...
0 votes
1 answer
804 views

Configure web.config to redirect non-www requests to www for multi-site Drupal 7 Install

I have a multi-site Drupal 7 install running on Azure that I would like to force all non-www traffic to the www address for all sites. I have tried a number of examples from around the web but none ...
0 votes
1 answer
1k views

Redirect before 404 page

I'm currently migrating a site to Drupal. The old site has thousands of dynamic URLs for which I cannot use a regular expression to handle them. Those URLs exist in a slightly different form in the ...
1 vote
0 answers
28 views

Site flashes intermediate 'Redirecting to ...' page

On a local development site an intermediate 'Redirecting to ...' page flashes for a second before rendering the correct page. This seems to be happening at various places, even on cron run page. The ...
  • 444
2 votes
1 answer
590 views

Get path from router and redirect after autocomplete selection

I have a form that is inflated inside a box. In that form I have an autocomplete field. I want to allow the user, when they select an item from the autocomplete's suggestions they are automatically ...
  • 346
4 votes
0 answers
502 views

Front page without language prefix

I have a multilingual site on Drupal 8 migrated from Drupal 7. It has URL language detection method. Default language is English, it has path prefix /en. With this configuration front page is ...
0 votes
1 answer
171 views

How to force D8 "Configuration synchronization" to send HTTPS download URL

I have a Drupal 8 site hosted on an Apache Server. There are 2 virtuals hosts : one listening on port 80, which redirects everything to HTTPS one listening on port 443 which serves the htdocs ...
  • 471
-2 votes
1 answer
76 views

How do I redirect a controller to a particular vocabulary overview?

I want to redirect my controller to a specific vocabulary page. I redirect my controller using this code. use Drupal\Core\Url; public function importTypes() { $liste_types = $this->getListTypes(...
1 vote
0 answers
60 views

How to create a rule to redirect users to specific content according to their email domain?

I'm trying to setup the Rules module in D8, but I'm unable to do so. I want to redirect users, according to their email domain they used to register themselves on my website, to specific pages: ...
  • 11
1 vote
2 answers
2k views

How to redirect to edit page on node create?

I am trying this code in my custom module but it does not redirect to the node edit page. function mymodule_entity_insert(EntityInterface $entity) { if ($entity instanceof \Drupal\node\...
  • 3,196
2 votes
2 answers
873 views

Redirect to a view with contextual filters

I would like to redirect the user to a view with some contextual filters on the submit of a custom form. For now I use this : $form_state->setRedirect('view.search.page_1', ['myvalue' => $...
  • 380
0 votes
1 answer
6k views

Trying to programmatically redirect

I’m trying to redirect users in Drupal 8 as I was used to do in Drupal 7 with a simple drupal_goto(). This is my code. $response = new \Symfony\Component\HttpFoundation\RedirectResponse(\Drupal::url(...
  • 942
0 votes
2 answers
2k views

Redirect user to previous page after registration

I'd like users registering on my website are redirected to the page where they clicked the "create account" button which is in a modal. First, I tried to redirect to an absolute url I tried $...
  • 33
0 votes
1 answer
144 views

Add redirection in submission handler

How can I redirect users to a node in a form submission handler similarly to the following code? In my form alter I have added an additional submit button: $form['actions']['save_and_exit'] = array( ...
  • 1,792
0 votes
1 answer
1k views

Add uid to existing menu link

I have a custom menu MyMenu and I have four menu items. What I want to do is to add the current uid as a parameter at the end of the link. In D7 I could use menu_tokens module which is not available ...
  • 883
2 votes
1 answer
82 views

How to perform a page redirect after submitting node with conditions?

I have a select list which contains A and B. If users choose A, then (after submitting the node) the users are redirect to URL A; if users select, they are redirected to URL B. I'm using Rules and ...
2 votes
1 answer
5k views

How do I pass parameters from a form redirect to a controller?

I feel like it should be easier to find this stuff out. I'm trying to pass some data from a form submission to a controller, and do something based on that data. What is the most Drupal way to do this ...
3 votes
1 answer
2k views

Redirect based on query string

I'm migrating a legacy blog from a home-grown CMS to Drupal 7 and I need to wrap my head around how I'm going to redirect URLS to a new aliased pattern. The legacy site's URLs use query strings /?t=...
0 votes
1 answer
49 views

Redirect example.com to example.com/node

Currently I am facing ERR_TOO_MANY_REDIRECTS problem in chrome when I try to visit example.com. Since example.com/node is working fine, I want to redirect all the traffic to example.com/node for now. ...
1 vote
1 answer
1k views

How can I maintain redirects from a non-existing path to an existing one?

With Drupal 7, the Global redirect module provided end users with a great interface to input redirects from a non-existing path to an existing one. I have installed and enabled the Redirect module for ...
0 votes
0 answers
309 views

It is possible to alter the $form_state['redirect'] of a previous submit callback?

For example: function awd_form_alter(&$form, &$form_state, $form_id){ dpm($form_id); if(substr($form_id, 0,22) == 'eck__entity__form_edit'){ $form['actions']['submit']['#...
2 votes
2 answers
869 views

How to redirect to another page using the url alias?

Here is my code where I am trying to redirect to a page using its url alias: $url= Url::fromUserInput('/thank_you_for_your_message')->toString(); $form_state->setRedirect($url); ...
  • 3,196
1 vote
1 answer
4k views

How to use TrustedRedirectResponse()?

I have used the following code on submit of a form to first send the form contents via guzzle and then redirect the form. I get the error Error: Call to undefined function TrustedRedirectResponse() ...
  • 3,196
0 votes
2 answers
315 views

Why form redirects to encoded url when having GET params?

I have a simple form with 1 select and I want it after the form submit to redirect to the same URL, but with added GET params. So in a form submit I added: $form_state['redirect'] = url(arg(0).'/'....
0 votes
1 answer
50 views

How do I create a landing page that can go to page--front?

I have two pages, the intro page (page--intro.tpl.php) and the front page (page--front.tpl.php). When you type worldovercomers.church, the front page loads. How can I set it so when the user visits ...
2 votes
1 answer
195 views

Redirect After Creating New Taxonomy Term

I am new to Drupal. I am trying to figure out if it is possible to redirect back to the Taxonomy page right after adding the new vocabulary term instead of being directed to the manage page of the ...
  • 21
0 votes
1 answer
873 views

a href links not showing url aliases

I am using redirect module with Drupal 8 latest version. It is working fine when we open any node in url, it converts node to the path alias. But issue is with a href links. When we hover on any "a" ...

1 2 3
4
5
17