Questions tagged [redirection]

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

Filter by
Sorted by
Tagged with
0
votes
0answers
13 views

htaccess rule subdomain should load a specific page

Hi for a Drupal 7 i need to make a redirect only for a language www.website.com stays the same when accessing when accessing fr.website.com should load the www.website.com/fr/homepage can someone ...
-1
votes
0answers
22 views

How to redirect 404 error to specific page?

How to redirect on website.com/articles/ when for example this url website.com/article/bla-bla-bla return error 404 ? Thank you.
0
votes
1answer
22 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
25 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 ...
0
votes
1answer
40 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
51 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
45 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
47 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
60 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
31 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
47 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
92 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
18 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
23 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
26 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
28 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
20 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
1answer
16 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
72 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
81 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
24 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
69 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
31 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
40 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
34 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
39 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
66 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('...
0
votes
0answers
27 views

Repointing a site a subdomain

I have created a new Drupal 8 site in a subdomain of an existing Drupal 6 site. The new site sits in public_html/dev - so the url for it is dev.mydomain.com. What is the best way to redirect ...
-1
votes
1answer
24 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
29 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
74 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
139 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
77 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
21 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
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
65 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
22 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 ...
3
votes
1answer
269 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
34 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
132 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
1answer
49 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
359 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
2 3 4 5
17