File .htaccess predefinito per WordPress?
-
-
C'è l'articolo sul codice di WordPress suifile [`htaccess`] (https://codex.wordpress.org/htaccess).There is the WordPress codex article about [`htaccess`](https://codex.wordpress.org/htaccess) files.
- 0
- 2015-05-18
- Nicolai
-
4 risposta
- voti
-
- 2012-03-17
Eccoil codicepredefinitoper quelfile.
# BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress
puoi controllare quiperilfile htaccesspredefinito.
http://codex.wordpress.org/Using_Permalinks .
Grazie.Spero che aiutipoco.
Here is the default code for that file.
# BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress
you can check it here for default htaccess file.
http://codex.wordpress.org/Using_Permalinks.
Thanks. I hope it helps little.
-
- 2012-03-17
WordPressnon contiene
.htaccess
nelformato difile.Le regole vengono scrittenelfile dallafunzione
save_mod_rewrite_rules()
e sonogenerati da$wp_rewrite->mod_rewrite_rules()
.Nota che l'installazionemultisito ha regole diverse (più complesse)e sembraesseregestitain modo diverso.
WordPress does not contain
.htaccess
in file form.The rules are written into file by
save_mod_rewrite_rules()
function and are generated by$wp_rewrite->mod_rewrite_rules()
.Note that multisite installation has different (more complex) rules and seems to be handled differently.
-
+1per lagiusta direzione.Perfavore,controlla se ho capitobene ilproblema con lamia risposta.Penso che la cosa centrale sia solo usare l'API Rewrite_WP,non reinventare la ruota confile .htaccesspersonali.+1 for the right direction. Please, review whether I understood the issue right with my answer. I think the central thing is just to use the Rewrite_WP API, not to reinvent the wheel with personal .htaccess -files.
-
- 2017-01-01
Unfile
.htaccess
predefinito è disponibile su https://wordpress.org/support/article/htaccess/ .A default
.htaccess
file can be found at https://wordpress.org/support/article/htaccess/. -
- 2012-04-22
Usa #wordpress di Freenodepertrovare la documentazione appropriata,di solitoin
/topic
. Lì hotrovato la chiaveClass WP_Rewrite
qui ,wordpress.org ufficiale è almassimoingannevolee dimarketing. Ad ognimodo,nonmescolare le regole di riscrittura di Apache con le regole di riscrittura di WP anche se la denominazione di WP èprobabilmente dall'equivalente di Apache.Gli stati dell'API WP_Rewrite
Puoi aggiungere regoleper attivare la visualizzazionee l'elaborazione dellapagina utilizzando questo componente. Lapienafunzionalità di unfront controllernonesiste,il che significa chenonpuoi definire lamodalità di caricamento deifilemodelloin base alle regole di riscrittura.
quindi devi usare l'APIperfare lemodifiche,non sei completamente sicuro di cosa significhimapenso che significhi chenonpuoifidarti deituoifile .htaccess hard-coded - le cosepotrebbero cambiare anche con diverse versioni di WD! Quindi usa l'API.
intercettazione
Il codice qui ha alcune condizioni seilfile .htaccessesiste -nonil 100% delle loroinferenzeperchénonben documentatoe nonpuò capirei nomi lì,mailmessaggio centrale èprobabilmente cheilmodo sicuropermantenere le regole di riscrittura è usare WP_Rewrite API,WPpotrebbe cambiarein futuro.
Adesempio,un semplice Apache-rewrite
RewriteRule ^hello$ Layouts/hello.html [NC,L]
è apparentemente qualcosa comeadd_rewrite("^hello$", "Layouts/hello.html")
,non hotestatoma hoprovato a seguire l'API di seguito:add_rewrite_rule (line 19) Add a straight rewrite rule. see: WP_Rewrite::add_rule() for long description. since: 2.1.0 void add_rewrite_rule (string $regex, string $redirect, [string $after = 'bottom']) string $regex: Regular Expression to match request against. string $redirect: Page to redirect to. string $after: Optional, default is 'bottom'. Where to add rule, can also be 'top'.
<$Related"
-
http://pmg.co/a-guide-per lopiù-complete-to-the-wordpress-rewrite-API
-
Grazie atoschoper l'assistenza qui ,alcune chiacchierein chat.
Use the Freenode's #wordpress to find the appropriate documentation, usually in the
/topic
. There I found the keyClass WP_Rewrite
here, the official wordpress.org is at the best misleading and marketing. Anyway, do not mix Apache's rewrite rules with WP's rewrite rules although the naming of WP is probably from Apache's equivalent.The WP_Rewrite API states
You can add rules to trigger your page view and processing using this component. The full functionality of a front controller does not exist, meaning you can't define how the template files load based on the rewrite rules.
so you must use the API to do the changes, not fully sure what it means but I think it means you cannot trust in your hard-coded .htaccess -files -- things may change even with different WD -versions! So use the API.
intercepting
The code here has some conditions if the .htaccess -file exists -- not 100% of their inferences because not well-documented and cannot understand the naming there but the central message is probably that the safe way to maintain the rewrite rules is to use the WP_Rewrite API, WP may change in the future.
For example, a simple Apache-rewrite
RewriteRule ^hello$ Layouts/hello.html [NC,L]
is apparently something likeadd_rewrite("^hello$", "Layouts/hello.html")
, haven't tested but tried to follow the API below:add_rewrite_rule (line 19) Add a straight rewrite rule. see: WP_Rewrite::add_rule() for long description. since: 2.1.0 void add_rewrite_rule (string $regex, string $redirect, [string $after = 'bottom']) string $regex: Regular Expression to match request against. string $redirect: Page to redirect to. string $after: Optional, default is 'bottom'. Where to add rule, can also be 'top'.
Related
http://pmg.co/a-mostly-complete-guide-to-the-wordpress-rewrite-api
Thanks to toscho for assisting here, some small-talk in chat.
-
Sono abbastanza sicuro di averfrainteso qualcosa qui,perfavore,rivedi questa chat [qui] (http://chat.stackoverflow.com/transcript/message/4000298#4000298).È statointercettatoperchéilmioblogera a livello di root,il che significava qualcosa come www.hello.com/blog/?I am quite sure I have misunderstood here something, please, review this chat [here](http://chat.stackoverflow.com/transcript/message/4000298#4000298). Did it intercept because my blog was on root -level meaning something like www.hello.com/blog/?
Imiei file
.htaccess
stannointercettandoilfile.htaccess
di WordPress.Qualimodulie qualiimpostazioni (specificate da
.htaccess
) sononecessariperfarfunzionare WordPress?In altreparole,dovepossotrovareilfile.htaccess
predefinito di WordPress?