Questions tagged [redirection]
Redirection in Drupal means sending the users to a different page.
851
questions
0
votes
1
answer
9
views
How can I redirect from a non-locale url to a specific locale
When moving an existing multilanguage site (Jive CMS) to Drupal we need to redirect URLs like /docs/DOC-1763 to the German version of a node. They are a lot, so we need a migration for it.
We're using ...
0
votes
0
answers
46
views
Migrated site redirects pages to front page on localhost
I migrated a Drupal 10 website that was created with my online server hosting applications, to a localhost (WAMP). The migrated site only shows homepage and redirects all other pages to the localhost ...
0
votes
1
answer
104
views
Which is the correct way to create redirects from existing nodes
I was discussing with a friend who usually makes different redirects on his site.
Having an existing and published Node he creates a new Node of the same Content Type and creates a redirect from the ...
0
votes
1
answer
123
views
How do I redirect to a different form in a _custom_access routing call
In my D10 application, it is required that I have a parallel user login system separate from the Drupal system (it is a requirement I cannot change). On my routing, I have the following:
...
1
vote
0
answers
32
views
Module redirects : replacement character for parameter in query string
I need to redirect old URLs that have parameters like
/my-page?page=1
/my-page?page=2
I thought I could use the urls redirect module to indicate a url with a replacement character but that doesn't ...
1
vote
1
answer
419
views
How can I programmatically trigger a 403 error with a hook implementation?
In a module within a drupal hook I'd like to conditionally trigger a 403 for the user.
I could archieve this e. g. by throwing an exception
throw new \Symfony\Component\HttpKernel\Exception\...
0
votes
0
answers
61
views
Dev redirects to prod on every URL
I've got a dev version of a production site that seems complete and responsive, but when I navigate to that site in my browser it takes me to the prod site.
I have grepped every .htaccess file on the ...
0
votes
1
answer
85
views
Clearing cache via admin_toolbar results in white screen with "Redirects to external URLs are not allowed by default"
After pressing this admin_tool button to Flush all caches, the browser hangs on a white screen with the message: Redirects to external URLs are not allowed by default, use \Drupal\Core\Routing\...
0
votes
2
answers
181
views
How to do Do a redirect in buildForm()?
I send a link to a URL by email. This page is created with a controller which contains a form (FormAPI). I pass a token as a parameter to secure access to this form. So I check if this token exists ...
0
votes
1
answer
327
views
Show message after redirection
This will be mostly a Drupal question rather may not have any relation to Drupal commerce checkout.
I have an Offsite Checkout redirect payment method in which I have a buildRedirectFrom as stated in ...
0
votes
1
answer
130
views
Website doesn't load properly from htdocs/web
Built a website on localhost, moved it to shared-hosting where webroot is htdocs but when visiting the website through the hosting's given IP address it obviously doesn't load the website, because the ...
-3
votes
2
answers
112
views
Using custom scheme (myapp://dashboard) in drupal simple-oauth2 module's redirect url
How can I use custom scheme i.e. myapp://dashboard for the redirect field of Drupal simple oauth2 module?
I get this error:
'myapp://dashboard is not a valid url'
I also tried to use the redirect ...
-3
votes
1
answer
64
views
I have deleted Redirect module and have lost alias-to-alias redirects as well as the ability to show aliases in some nodes
I uninstalled and removed the Redirect module using these commands.
vendor/bin/drush un redirect
composer remove drupal/redirect
This caused me to lose about 15 alias-to-alias redirects.
I have also ...
1
vote
0
answers
100
views
Contrib module service overriding not working
I am using the ‘Path Redirect Import module along with the Redirect module.
I am trying to override its service ‘path_redirect_import.importer’
To do this, I have added a service provider and a custom ...
0
votes
1
answer
115
views
Is there any danger in uninstalling Redirect module?
Drupal 9.5.3 with no core customizations and very few contrib modules:
Redirect
Asset Injector
Token
All nodes in this website have alternative aliases such as example.com/my-first-node instead of ...
0
votes
1
answer
460
views
Url-aliases or redirect without language prefix
How can I use url-aliases in additional languages without the language prefix?
From his old homebrew-CMS, my client has the following URLs:
example.com/english-page => redirecting to example.com/...
0
votes
0
answers
66
views
Website URL issue
I have an Drupal 10 installation on my Macbook Air. The web root is ~/Sites/drupal10/web. I have a hosts file entry pointing d10.mf.local to localhost and I have an Apache Vhost set up with ServerName ...
-3
votes
1
answer
54
views
Preventing one site from redirecting to www. prefix in multisite [closed]
I am using Drupal 9, multi-site. Generally, for all sites except one, i want to redirect from non-www to www prefix and i'm using the root .htacces file for it by uncommenting redirect rules. But the ...
0
votes
1
answer
299
views
Stripe doesn't see API key after TrustedRedirectResponse
I have a controller that calls the Stripe API using stripe-php to create a checkout session.
/**
* Checkout using Stripe.
*
* @param \Symfony\Component\HttpFoundation\Request $request
* ...
0
votes
1
answer
1k
views
How to redirect custom ajax form to external url with headers
When setting the form with ajax handler like this
public function buildForm(array $form, FormStateInterface $form_state) {
//...
$form['actions']['submit'] = array(
//...
'#ajax'...
0
votes
0
answers
67
views
How can we redirect from a node's /latest URL if there is no latest moderation state when the user clicks it?
Drupal 9: We want to link users to the node's "/latest" URL but if there is not currently a latest version then they get an access denied message. We'd like to, instead, redirect the user to ...
0
votes
0
answers
106
views
Keep page published or unpublish?
Such a simple question I'm sure, but I can't find anything anywhere on this. I ran lots of tests - if the page is deleted the redirect doesn't work, but whether I unnpublish or keep the page published ...
2
votes
1
answer
593
views
How to redirect to a specific page after submitting password reset?
When a logged in user resets their password at /user/password and clicks the submit button, they are being redirected to the frontpage.
How can I redirect to /user instead?
I've tried the second ...
1
vote
1
answer
454
views
Redirect user to a custom page after one time login
If my user click to "forgot password", and email with a one-time login is sended.
When the user clicks the given link, he's redirected to this page /user/reset/$id with the user_pass_reset ...
3
votes
2
answers
1k
views
Redirect doesn't work for .pdf file
Is it possible to create a redirect for documents using the Redirect module? I can't seem to find a solid answer. Basically I'm just trying to create a redirect from https://www.example.com/default/...
0
votes
1
answer
201
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 ...
0
votes
0
answers
77
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 ...
0
votes
1
answer
845
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, ...
1
vote
0
answers
269
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, ...
0
votes
1
answer
465
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.
...
-4
votes
1
answer
80
views
Dealing with tens of thousands of 404's when migrating from MediaWiki to Drupal [closed]
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 ...
1
vote
1
answer
120
views
Is there a way to redirect any 404 to the homepage? [duplicate]
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 ...
0
votes
2
answers
2k
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 `...
0
votes
1
answer
276
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:
/**
* ...
0
votes
1
answer
937
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 ...
0
votes
2
answers
622
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
...
0
votes
1
answer
280
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 ...
0
votes
2
answers
229
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 ...
1
vote
1
answer
231
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.
...
-2
votes
1
answer
1k
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/...
0
votes
1
answer
423
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 ...
0
votes
0
answers
102
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 ...
5
votes
1
answer
387
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(...
0
votes
0
answers
53
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.
0
votes
0
answers
146
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
1
answer
326
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
2
answers
1k
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....
3
votes
2
answers
2k
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
0
answers
234
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
1
answer
140
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']['...