Questions tagged [redirection]

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

Filter by
Sorted by
Tagged with
-5
votes
0answers
20 views

Url direct not working

I am trying to redirect a url in drupal 8 but its showing warning. if save it after input source and destination path redirect not working. Warning: The source path /source-path is likely a valid path....
0
votes
0answers
38 views

How do I force /web in the URL?

I have installed Drupal 8 as multi-site using Composer (as described by kalose). Basically, the folders created as subdomain-folders have been replaced with a symbolic link to the respective sub-...
0
votes
1answer
26 views

How do I redirect to the login page?

I have a custom search form which appears in the modal and is accessible only to logged in users. The ajax url of the form is /my/custom/search/modal/{nojs}. The router definition is the following one....
0
votes
2answers
35 views

How can I programmatically bulk delete redirect entities based on their status code?

I have a list of 3089 301 redirects URLs and want to delete them programmatically from the database. E.g List of source URLs /about/test/2013/page_61732.html /about/test/additional/branches/page_38678....
0
votes
2answers
39 views

How do I get group to which the node belongs and redirect anonymous users to the login page if they land on it?

I'm using the Drupal Group module and I've added content to a Drupal group I've created. I've also added users to this Group. Works well: Drupal users have to login to see this content in that group. ...
0
votes
0answers
18 views

Rabbit Hole redirects not working for admin

I have a problem with Rabbit Hole redirects. I've set rabbit hole redirect for a content type, saved it, cleared cache. The problem is that the redirects work only for anonymous users. When I am ...
0
votes
0answers
34 views

How to redirect logged in user to different page rather than what is configured in basic site setting? [duplicate]

I have the following requirement: When an anonymous user visits the site, they will get /login page which is configured in Configuration -> Basic site setting -> Front page. After logging in ...
0
votes
1answer
18 views

Form submission not saved when using a dynamic redirect

I have forms where I use a form alter to set various form fields on the fly. One of which is the Thank You page field that a user should go to after submitting. Example $form['submitted']['...
0
votes
1answer
55 views

URL Redirects and Configuration Management

I have installed Drupal's Redirect module to redirect from old URL's to new ones. I have added the required redirects in my local environment, ran drush cex but can not see the redirects in the export ...
1
vote
1answer
51 views

How to insert custom redirect script in index.php without losing it on update

At the moment I'm migrating an old site to Drupal. To redirect all old url's to new ones, I made a script that has to be inserted before anything goes off, so in index.php at the top. <?php ...
0
votes
0answers
11 views

How to htaccess redirect homepage url to external url without affecting other internal website links

I have an archive website say here: www.myarchivesite.com I do not need this site, just a subfolder here www.myarchivesite.com/useful-pages-in-here/ Is there anyway, for example htaccess, that I can ...
1
vote
1answer
105 views

How can I redirect user, while showing them a status message?

I'm working on a custom module, in which I want to redirect users, while showing them a status message. What I've tried so far only works for authenticated users but I want to redirect anonymous users....
1
vote
1answer
104 views

Redirection cached?

I have 2 versions of site (with same code), one for Switzerland (.ch) and other for rest of the world (.com). What I need is that if someone from Switzerland visits .com is redirected to .ch And other ...
1
vote
1answer
43 views

Inconsistent behavior with user_logout function

For a drupal 8 site, I have a custom function that does the following: It logs out the user and sends them to an external url Inside the controller CustomController, I have: function custom_logout(){ ...
0
votes
0answers
42 views

Redirecting causes dead loop?

Some of my articles are protected - allowed only if user is logged in. In case anonymous is trying to open them page "Access denied. You are not authorized to access this page." is displayed,...
3
votes
1answer
47 views

Redirect to a specific tab in a page after node submit

I'm working on Drupal 8.9.6. I'm trying to redirect users to a particular page after they add a node. I can do that without any problem, by adding the following information in the form's URL: /node/...
-2
votes
2answers
60 views

redirect /node?page=1 to main page

I have already indexed drupal-8 website's pages with pattern like - node?page=1; node?page=2 and so on I would like to redirect them to site's front page Tried: I have tried with the redirect module ...
0
votes
0answers
28 views

Redirection 301

I used the redirect module to do a 301 redirection. Everything works fine for the first few hours. Then, afterwards when I enter the old link, the redirection doesn't work anymore. If I go and clear ...
1
vote
2answers
56 views

Batch redirect to http instead of https

i'm working on a project and all batch callbacks in http not https so instead of redirecting to https://example.com/batch?id=844&op=start redirect to http://example.com/batch?id=844&op=start, ...
3
votes
2answers
221 views

Redirect to webform from controller and back to custom form

I have a use case where I'm creating a custom form, but for business reasons, I need to obtain customer information in a separate webform prior to granting access to my custom form. So my workflow ...
0
votes
0answers
46 views

Why is my site redirecting to https?

I've set up a test environment for our live drupal site so that we can test PHP/Drupal core upgrades.ee The test sites can't redirect to HTTPS as the self-signed certs won't work on a browser, so I ...
1
vote
1answer
61 views

EventSubscriber returning correct content but status code is 404

As the title says, content is being returned correctly but the status code is 404. I have checked the .htaccess file and the Apache config file as well. All seems to be fine. I have the following in ...
1
vote
1answer
63 views

How do I redirect a domain but keep the URL structure?

I have example.com and example.co.uk. They both point to the same Drupal installation on my server, so both domains load the exact same site. I am now trying to redirect the .co.uk to the .com domain. ...
2
votes
1answer
96 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 ...
-5
votes
1answer
184 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
339 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
23 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
48 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
41 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
113 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
26 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
71 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 ...
3
votes
1answer
292 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
58 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
195 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
69 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
1answer
71 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&...
1
vote
3answers
180 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
20 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 ...
1
vote
1answer
32 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
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
24 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
40 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
3answers
191 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
1answer
82 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
43 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
33 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 ...
1
vote
1answer
154 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
1answer
55 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 ...

1
2 3 4 5
17