Questions tagged [redirection]

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

Filter by
Sorted by
Tagged with
2
votes
1answer
61 views

Alter Header Status Response to 410

I have several urls with "/tag/" string; some of them have content and some of them don't, so they return 404. How can I force them to return a 410 only for those that have no content? I ...
-7
votes
1answer
52 views

How to redirect the user to the home page?

I have Drupal 8.9. When users access the site, they are redirected to their user account page. I want them to be redirected to the home page. If I leave the Default front page setting empty, the users ...
0
votes
1answer
31 views

Redirect with POST and parameters in a controller

I want to redirect to a url (Sermepa/Redsys) with POST and some form parameters in a Controller. The process is I submit a form that collect some data, and when the user submit this form, it redirect ...
-3
votes
1answer
21 views

Why don't my redirects work?

I use redirect module. If I try to redirect from, for example, /theorien/1290 to /lektionen/11, I get a Page not found error after trying to visit /theorien/1290. Redirecting doesn't work for any path....
0
votes
0answers
43 views

How can I redirect to a particular page or front page after login via a social networking site?

In my Drupal 8 site, In the comment section, I have one button ("Add new comment"). Clicking on it will open a login pop up and user will be redirected to the same page. For that, I added the ...
0
votes
1answer
37 views

Custom module interfering with CSS on /user page

I am having trouble with a custom module. When my site is working properly, the /user page loads 4 CSS files. After rebuilding the cache, only three files load. It's not a 404, Drupal doesn't even try ...
0
votes
1answer
55 views

How can I create 301 redirects from “unclean” URLs?

I am moving a Wordpress site to Drupal and want to ensure that proper 301 redirects are in place for SEO purposes. The old urls are in the form of: http:www.domain.com/?page_id=123 I was hoping ...
0
votes
1answer
23 views

How to show or hide some content on a node view using Page Manager based on the url destination?

After certain fields have been set on the edit node form and saved, I don't want the node author to change these anymore and therefore I have created a new variant with a response code "301 permanent ...
0
votes
1answer
28 views

What is the best way to redirect node to node

I am trying to figure out what is the best way to create a redirect from one node to another. For example, say we have two nodes: node/1 | path-one node/2 | path-two I created the following redirect:...
0
votes
1answer
42 views

Disable cache on base url for redirecting unauthenticated users

I am trying to redirect unauthenticated users. So anytime an unauthenticated user tries to get to the base url, redirect them to an external url. Currently works, but continues to redirect to the ...
0
votes
0answers
16 views

Whats the file structure and correct implementation of using StackMiddlware for a redirection? [duplicate]

I'm currently using an EventSubscriber to successfully redirect unauthenticated users from my site. However, the redirection still takes place on that specific page even after the user is logged in ...
2
votes
0answers
66 views

How to implement StackMiddleware for a redirection correctly?

I'm working on a redirection (for unauthenticated users) for my Drupal 8 site. Currently, the redirection works however, the redirection persists even after user is authenticated. I found this article ...
1
vote
0answers
51 views

How to make EventSubscriber run on every page load? [duplicate]

Tripped up on how to make my EventSubscriber code run on every page load. In my src/EventSubscriber/RedirectAnonymousSubscriber.php file here's my code: <?php namespace Drupal\mymodule\...
-1
votes
1answer
69 views

Redirecting Anonymous Users to external URL on Drupal 8 site

Still pretty new to Drupal, but I am attempting to create a custom module that redirects anonymous/unauthenticated users away from the site. This site is only supposed to be used by admin's so in ...
0
votes
1answer
63 views

Redirect from within controller always goes to home page

I have a custom module named rsc. My Default 404 (not found) page is set to /page-not-found in Basic site settings. My rsc.routing.yml file contains rsc.pageNotFound: path: '/page-not-found' ...
0
votes
0answers
36 views

How do I use URL redirect with token?

I am using url_redirect. I want to redirect users to /prize_page when they click on my account link /user/[current-user:uid]. It seems the [current-user:uid] token doesn't work. Is there any way ...
0
votes
1answer
52 views

The page isn’t redirecting properly

I have been trying to intercept a page request from /node/nid which is of type the_content_type and then appending some facet query parameters to it which is something like this ?f[0]=city%3A160&...
0
votes
0answers
32 views

Redirect user after registration? [duplicate]

I would like to redirect the user to the user page (instead of the home page) right after registration submit. This seems like it should be an easy task, but I am struggling with it way more than I ...
1
vote
3answers
99 views

Where and how to conditionally redirect old aliases to new aliases

We are replacing a website with a new version. The domain is the same, but URL aliases in the new website are different. In many cases, I can use an old alias to calculate its corresponding new ...
0
votes
1answer
19 views

Send view field in URL - Drupal

I have a search page created with embedded filters in Drupal 8 View. In the list of fields I have a fields - [Field_program_id]. I also have a button 'Learn more' when clicking this button I want to ...
0
votes
0answers
24 views

Lets’ encrypt redirection problems

Desperately seeking help, I am hosting multiple Drupal 7 sites on one Ubuntu 16 on AWS using apache. I have domain1.com and new.domain2.com In the DNS level, I am pointing to this computer IP for ...
1
vote
1answer
30 views

What is the proper way to show a visitor an error?

I'm using a custom submit handler for a Webform, which POSTs important form data to another API. That part works, but on occasion there may be random network errors that prevent a successful ...
1
vote
0answers
29 views

Redirecting when processing inbound

I want to redirect users when a condition is met. I want to do the redirect when processing the inbound, so therefore I created a path processer, which implements the InboundPathProcessorInterface ...
1
vote
2answers
32 views

What rule to use to redirect users, unless already redirected?

I'd like users with certain roles to be redirected to the page /civicrm when they login, unless they've already been redirected elsewhere. For example, an email might have a link that directs them to ...
0
votes
0answers
21 views

How to set a theme for a 403 access denied?

When a user clicks a link to a Drupal site and are denied access because they need to login, they get a 403 access denied screen inviting them to login. I want to set a responsive theme because some ...
0
votes
0answers
32 views

redirection in htaccess file

I'm working on Drupal7. I want to redirect all the URl's to external domain except some. Below rewrite I have added in .htaccess file and its working fine. RewriteCond %{REQUEST_URI} !/user.*$ ...
0
votes
0answers
18 views

Redirect logged in users to a verification page

We require our users to verify their phone numbers upon creation or number change. If there is no logged in user, they get redirected to the login page no matter what path they type into the browser. ...
0
votes
3answers
79 views

How to redirect a user on login?

I have a registration form, when submitted, the user gets logged in automatically. I want to redirect the users to a specific page on login. Whether they are logged in using the login form or through ...
1
vote
0answers
85 views

Why would redirected files create 404's at website's root? [closed]

When my Drupal 7 site was built (not by me), there was a schematic file field created within our "Tool" nodes to upload tool schematics PDF files with the file directory set to sites/default/files/...
1
vote
1answer
79 views

Redirect from route when the controller has been changed [duplicate]

I'm trying to redirect to an external URL in a custom controller whenever I land on the 404 page. Right now I alter the controller destination in a route subscriber like this: public function ...
0
votes
0answers
42 views

Can I use KernelEvents::EXCEPTION to make exceptions for my own code?

I've written code for a custom module in my .MODULE file that looks like this. function cookie_authentication_node_access(NodeInterface $node, $op, AccountInterface $account) { if ($account->...
0
votes
1answer
27 views

Redirect to view display after form submission

I'm using a form_alter hook to add a custom submit callback. I want to redirect the user to a particular page display of a view. However, I'm having trouble figuring out how to specify the path. In ...
0
votes
1answer
81 views

How to get the uncached version of request headers?

We need to programmatically get the request headers using the mymodule_preprocess_page hook. To do this we tried the following, however, because we have CDN, Varnish, and Drupal Cache all enabled, the ...
0
votes
0answers
32 views

Redirect from a path

I have a routing.yml file with a path which triggers a controller method. When the controller method finishes the operation I want to return user to the page he came from originally. I don't want to ...
0
votes
1answer
45 views

Endless redirect on paths containing question marks

A similar question was posted here: EventSubscriber endless redirect But I haven't quite been able to implement a workable solution. On Drupal 8.73: Basically we have a custom module that is ...
0
votes
0answers
36 views

Can't go anywhere from user edit page after login

Having an issue with a certain user that is not reflected on other users, when this particular user is logging in he isn't redirected to homepage or to admin/dashboard but to user/edit page, ...
0
votes
0answers
65 views

How can we add header in redirect url just like adding header in curl

I am trying to call an external url from a drupal environment using RedirectResponse. In this request I need to add a custom header. I tried it using cURL and I got the custom header in the request ...
0
votes
0answers
110 views

How set a custom redirect confirmation path to webform programmatically

i'm trying to set a custom URL to redirect when the process of webform submit is completed without use the confirmation settings of webform. I Actually try with this: $entity->setSettingOverride('...
-1
votes
1answer
25 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
37 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
78 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
159 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
61 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 ...
0
votes
1answer
32 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
78 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
0answers
23 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
74 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 ...
3
votes
1answer
336 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
38 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
1answer
152 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 ...

1
2 3 4 5
17