Come impedire il reindirizzamento automatico?
-
-
Seguardi cosa sta succedendo (tramite HttpFox o WireShark o uno sniffer dipacchetti simile),quellepagine reindirizzano con uno Stato 301 - Spostatoin modopermanente - che è un comportamento appropriato.Aiutai motori di ricerca amantenere aggiornatii propri database,tra le altre cose,e il reindirizzamento aiutagli utenti atrovare lepagine.Ciòpotrebbeinfluire sulmodoin cui WordPressgestisce le cose quando spostieffettivamente unapagina omodifichi unpermalink,quindifai attenzione.Comunque,latua sceltamanon sono sicuro che sia unabuonaidea.If you watch what is happening (via HttpFox or WireShark or a similar packet sniffer), those pages redirect with a 301 Status-- Moved Permanently-- which is appropriate behavior. It helps search engines keep their databases up to date among other things, and the redirect helps users find pages. This may effect how WordPress handles things when you actually do move a page or change a permalink, so be careful. Anyway, your choice but I am not sure it is a good idea.
- 0
- 2012-11-08
- s_ha_dum
-
So che è unabuona cosa,lo capisco.Tuttavia,ho un caso d'usoparticolarein cuinon avevobisogno di quel comportamento.Sto sviluppando unplugin chegestisceil reindirizzamento degli URLe quindi desidero sovrascriveretale comportamento.I know it's a good thing, I do understand that. However, I have a particular use case where I did not need that behaviour. I am developing a plugin which handles URL redirection and so I want to override that behavior.
- 0
- 2012-11-09
- Mazatec
-
Ecco una rispostapiù corretta: [link] (http://wordpress.stackexchange.com/questions/92103/disable-wordpress-url-auto-complete#answer-92104)Here is a more correct answer: [link](http://wordpress.stackexchange.com/questions/92103/disable-wordpress-url-auto-complete#answer-92104)
- 0
- 2014-12-19
- Binod Kalathil
-
2 risposta
- voti
-
-
Puoiguidarmiper quello chefarà?cos'èil reindirizzamento canonico?sononuovo su wordpressCan you guide me for what it will do? what is canonical redirect? i am new to wordpress
- 0
- 2014-09-25
- Yatin Mistry
-
Mi hai appena risparmiato un sacco dimal ditesta!grazie !MrGreenYou just saved me a lot of headaches! thank you ! :-D
- 0
- 2016-02-26
- Jenski
-
Non c'ènessunposto dovepossiamo vedere questi reindirizzamentiin modo dapoterli rimuovere unoper uno?Is there nowhere where we can see these redirects so that we can remove them on a one by one basis?
- 1
- 2017-02-22
- Shane Jones
-
Questo èfantastico.Saiperché `wp-admin`potrebbe ancoraessere reindirizzato dopo averlo usato?This is great. Do you know why `wp-admin` might still be redirecting after using this?
- 0
- 2018-02-03
- Gezim
-
Èpossibiletrovare una spiegazione dettagliata di questoproblema su https://www.dev4press.com/blog/wordpress/2015/canonical-redirect-problem-and-solutions/You can find a detailed explanation of this issue at https://www.dev4press.com/blog/wordpress/2015/canonical-redirect-problem-and-solutions/
- 0
- 2019-01-14
- ronnefeldt
-
Credo che dovrebbeessere remove_filterinvece di remove_action.I believe it should be remove_filter instead of remove_action.
- 0
- 2020-01-12
- Shawn
-
-
- 2017-03-30
Come suggerito da Ash,puoi disattivare lafunzione utilizzandoil seguente codice:
remove_action('template_redirect', 'redirect_canonical');
Osservando lafunzione redirect_canonicalin canonical.php,sembrerebbe chetupossa anchemodificareil comportamento coniltuofiltro.
Allafine dellafunzione redirect_canonical (),c'è una chiamataperfiltrare la rispostafinale:
$redirect_url = apply_filters( 'redirect_canonical', $redirect_url, $requested_url );
Quindipotresti scrivereiltuofiltropermodificareil reindirizzamentofinale o restituirenullperinterrompereil reindirizzamento,in base all'input, disattivando lafunzioneper unparticolare URL o un sottoinsieme di URL.
As Ash suggested, you can turn off the feature by using the following code:
remove_action('template_redirect', 'redirect_canonical');
In looking at the redirect_canonical function in canonical.php, it would appear you can also modify the behavior with your own filter.
At the end of the redirect_canonical() function, there is a call to filter the final answer:
$redirect_url = apply_filters( 'redirect_canonical', $redirect_url, $requested_url );
So you could write your own filter to modify the final redirection or return null to stop the redirection, based upon the input, thus turning off the feature for a particular URL or a subset of URLs.
-
Questo [SO] (https://wordpress.stackexchange.com/a/326553/181880)mostramaggiori dettagli su come aggiungere unfiltroper coloro che comeme sono unpo 'nuovi a WPThis [SO](https://wordpress.stackexchange.com/a/326553/181880) shows more details on how to add a filter for those like myself who are a bit new to WP
- 0
- 2020-01-30
- PBMe_HikeIt
Wordpress ha unafunzioneper cui reindirizzerà automaticamentei tuoi URL se li rileva scrittiin modoerrato.Ecco unesempio: ho unapagina chiamata
my-page
Se vado a:
mi reindirizzeràimmediatamente a
poichénonesistenulla alprimo URL.
Comefaccio a disattivare questafunzionee ottenereinvece un 404 se vengono digitati URLerrati?