Questions tagged [redirection]

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

Filter by
Sorted by
Tagged with
0 votes
1 answer
43 views

Custom alias for home page

I have a bilingual website (French and English) I have set "/fr/nom-de-page" as the home page in /fr/admin/config/system/site-information But Drupal 9.4.5 insist on redirecting to /fr/ I ...
user avatar
  • 137
0 votes
0 answers
52 views

How do I redirect users after login without using contributed modules?

We have to upgrade Drupal 8.9 to Drupal 9.3.3; since the login_destination module stop working, and we don't know why, I've tried others modules like Anonymous Login, Redirect After Login, User ...
user avatar
0 votes
1 answer
88 views

Programmatic webform redirect on submission not redirecting

I have a webform with the confirmation set to redirect to URL (redirects to a custom path or URL) In my webform handler, I have the following: public function confirmForm(array &$form, ...
user avatar
1 vote
0 answers
40 views

Session/cookie not working for some data on certain conditions

I'm trying to simply redirect to a certain page after is visited. The scenario : the user click on a link. If the user a certain data (a store, for drupal commerce), he can go to my node. If not, ...
user avatar
  • 57
0 votes
1 answer
42 views

check if a page has been redirected and then add a class to a certain div

Im using the redirect module to redirect /page/scheduling to /page. I need to check if the user arrived to a certain page by this redirect. by checking this i will then add a class to a certain div. ...
user avatar
-4 votes
1 answer
52 views

Dealing with tens of thousands of 404's when migrating from MediaWiki to Drupal

I have a MediaWiki 1.36.1 website with nearly 2,500 content webpages (generally all of these are either article or Category:) which I consider to migrate to Drupal. Moving each piece of content from ...
user avatar
0 votes
1 answer
37 views

Is there a way to redirect any 404 to the homepage?

I understand that Drupal doesn't have a core module to handle redirects and that's normally done by the Redirect module, or from the webserver. But if I want to redirect any 404 to the homepage, due ...
user avatar
0 votes
1 answer
306 views

ERROR 1062 (23000): Duplicate entry '/-de' for key 'PRIMARY'

When importing a dump from a production site with mysql in a xampp environment I got this error: ERROR 1062 (23000): Duplicate entry '/-de' for key 'PRIMARY' These lines are affected: ALTER TABLE `...
user avatar
0 votes
1 answer
73 views

Changing a node alias to reuse his old url programmatically without be still redirected to the node page

I'm on a old site on drupal 7. I have a node with alias /url. Now I need to manage that page url programmatically, so I create an item in a custom module using hook_menu() in this way: /** * ...
user avatar
  • 11
0 votes
1 answer
137 views

How do redirect a user after login to a route that requires the UID?

I know, this seems like a basic question: In Drupal 9 how do I redirect a user after logging in to a path/route that requires the UID in the path? I've researched and tried different implementations ...
user avatar
  • 1,007
0 votes
0 answers
34 views

Redirect existing file url to url

I have existing file with url: https://example.com/sites/default/files/public_files/pages/example%20documents/document.pdf and I want to redirect it to: https://example.com/en/new-url I did not find ...
user avatar
  • 341
0 votes
2 answers
53 views

Redirecting to a route name

I've recently built a module. In the twig template that I render, you can delete an item. For example it goes to /delete/item/1. That works fine. that route triggers a delete method from my controller ...
user avatar
0 votes
1 answer
75 views

Anonymous user redirected to core/install.php while admin does not

As an admin I've built a large table on Drupal 8 (php, mysql). It runs without issues for Admin, but trying as Anonymous user it redirects me to core/install.php Since it's ONLY affecting Anonymous ...
user avatar
  • 17
0 votes
2 answers
50 views

redirect an old url that no longer exists related to a file to a new one

I have 2 urls: www.example.com/somefile.pdf www.example.com/somefileNew.pdf the first one no longer exists, i want to redirect this url to the new one. I tried to use the redirect module to no avail ...
user avatar
1 vote
0 answers
63 views

Redirect directly to the payment provider page

I'm building a store with Drupal Commerce and creating my own off-site payment gateway. On the review page, after selecting payment method, the user can click the button to pay and finish the order. ...
user avatar
  • 370
-2 votes
1 answer
254 views

How to open a form in modal from controller while redirect

I can open a form in modal when click on a link (and there are lot of examples in the net as well). What I like to do: When some one go to a url in browser or redirect to a url, it will open a dialog/...
user avatar
0 votes
0 answers
21 views

Using memcached and ip_ban simultaneously?

Memcached is by no doubt an essential tool to speed up Drupal websites. Is there a way to use the ip_ban module in order to block certain countries from accessing my website before the cached content ...
user avatar
  • 101
0 votes
1 answer
132 views

Pass a value via URL to a node edit form and use it to redirect after saving the node

I have a node that includes a series of embedded views. When displaying, I have to pass a value via URL arguments (http://example.org/node/x?id=y), so that the views can get the appropriate ...
user avatar
  • 59
0 votes
0 answers
45 views

How do I redirect users from the server IP to the URL with path?

I'm working on a Drupal site. Everything works when I access the site using its IP address. My supervisor made an Nginx redirection on another server to the site's IP. Now the site should be ...
user avatar
5 votes
1 answer
300 views

In a hook, how can I distinguish between web users and JSON:API users?

I have a Drupal website that also hosts an Ionic app via JSON:API. I want website users to be redirected on entity insert, so I added a redirect like this: function MYMODULE_flagging_insert(...
user avatar
0 votes
0 answers
37 views

How can we build a view of nodes with their redirect source URLs shown in it?

I want to build a view of nodes with their redirect source URLs along with node titles. However a direct relationship cannot be established as they do not have a common reference.
user avatar
  • 814
0 votes
0 answers
54 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-...
user avatar
  • 59
0 votes
1 answer
57 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....
user avatar
0 votes
2 answers
378 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....
user avatar
  • 35
2 votes
2 answers
566 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. ...
user avatar
0 votes
0 answers
81 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 ...
user avatar
0 votes
1 answer
54 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']['...
user avatar
0 votes
1 answer
192 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 ...
user avatar
  • 21
1 vote
1 answer
62 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 ...
user avatar
  • 227
1 vote
1 answer
266 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....
user avatar
  • 547
4 votes
1 answer
430 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 ...
user avatar
  • 385
1 vote
1 answer
59 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(){ ...
user avatar
  • 135
0 votes
0 answers
96 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,...
user avatar
  • 385
3 votes
1 answer
61 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/...
user avatar
  • 55
-2 votes
2 answers
73 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 ...
user avatar
  • 7
0 votes
0 answers
29 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 ...
user avatar
  • 21
1 vote
2 answers
205 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, ...
user avatar
  • 6,617
3 votes
2 answers
627 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 ...
user avatar
  • 1,181
0 votes
0 answers
68 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 ...
user avatar
1 vote
1 answer
113 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 ...
user avatar
1 vote
1 answer
299 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. ...
user avatar
2 votes
1 answer
199 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 ...
user avatar
-2 votes
1 answer
1k views

How to redirect the user to the home page?

When users access the site, they are redirected to their user account page. I want to redirect them to the front page. If I leave the Default front page setting empty, users are redirect to their ...
0 votes
1 answer
1k 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 ...
user avatar
  • 600
0 votes
1 answer
49 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 ...
user avatar
0 votes
1 answer
309 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 ...
user avatar
  • 1,017
0 votes
1 answer
31 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 ...
user avatar
  • 338
0 votes
1 answer
37 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:...
user avatar
  • 3,297
0 votes
1 answer
133 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 ...
user avatar
4 votes
1 answer
831 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 ...
user avatar

1
2 3 4 5
17