{"id":1186,"date":"2023-11-07T14:05:27","date_gmt":"2023-11-07T19:05:27","guid":{"rendered":"https:\/\/www.hostinglabs.net\/content\/?post_type=ht_kb&#038;p=1186"},"modified":"2023-11-07T14:05:30","modified_gmt":"2023-11-07T19:05:30","slug":"como-puedo-usar-htaccess-con-nginx-en-ploi","status":"publish","type":"ht_kb","link":"https:\/\/hostinglabs.net\/asistencia\/base-de-conocimientos\/como-puedo-usar-htaccess-con-nginx-en-ploi\/","title":{"rendered":"\u00bfC\u00f3mo puedo usar htaccess con NGINX en Ploi?"},"content":{"rendered":"\n<p>La respuesta corta aqu\u00ed es: no puedes. NGINX no proporciona soporte nativo para htaccess. Sin embargo, eso no significa que no sea posible en absoluto.<\/p>\n\n\n\n<p>Es posible convertir las reglas de htaccess en reglas NGINX para que pueda seguir obteniendo el mismo comportamiento. Existen numerosas herramientas que pueden convertir f\u00e1cilmente algo como esto:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nRewriteEngine on\nRewriteBase \/\nRewriteCond %{REQUEST_FILENAME} !-f\nRewriteCond %{REQUEST_FILENAME} !-d\nRewriteCond %{REQUEST_URI} !=\/favicon.ico\nRewriteRule ^ index.php &#x5B;L]\n<\/pre><\/div>\n\n\n<p>En las reglas v\u00e1lidas de NGINX, algunas de esas herramientas se resumieron:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/winginx.com\/en\/htaccess\/?ref=ploi.io\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/winginx.com\/en\/htaccess<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/www.getpagespeed.com\/apache-to-nginx\/?ref=ploi.io\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/www.getpagespeed.com\/apache-to-nginx<\/a><\/li>\n<\/ul>\n\n\n\n<p>NGINX incluso escribi\u00f3 un&nbsp;<a href=\"https:\/\/www.nginx.com\/blog\/converting-apache-to-nginx-rewrite-rules\/\" rel=\"noreferrer noopener\" target=\"_blank\">art\u00edculo de blog<\/a>&nbsp;sobre la conversi\u00f3n de las reglas htaccess en reglas NGINX.<\/p>\n\n\n\n<p>Teniendo en cuenta el ejemplo anterior de htaccess, la mayor\u00eda de las herramientas los convertir\u00e1n en algo como esto:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nserver {\n    location \/ {\n        try_files $uri $uri\/ \/index.php$is_args$args;\n    }\n}\n<\/pre><\/div>","protected":false},"excerpt":{"rendered":"<p>La respuesta corta aqu\u00ed es: no puedes. NGINX no proporciona soporte nativo para htaccess. Sin embargo, eso no significa que no sea posible en absoluto. Es posible convertir las reglas de htaccess en reglas NGINX para que pueda seguir obteniendo el mismo comportamiento. Existen numerosas herramientas que pueden convertir f\u00e1cilmente&#8230;<\/p>\n","protected":false},"author":2,"comment_status":"open","ping_status":"closed","template":"","format":"standard","meta":{"footnotes":""},"ht-kb-category":[64],"ht-kb-tag":[],"class_list":["post-1186","ht_kb","type-ht_kb","status-publish","format-standard","hentry","ht_kb_category-ploi"],"_links":{"self":[{"href":"https:\/\/hostinglabs.net\/asistencia\/wp-json\/wp\/v2\/ht-kb\/1186"}],"collection":[{"href":"https:\/\/hostinglabs.net\/asistencia\/wp-json\/wp\/v2\/ht-kb"}],"about":[{"href":"https:\/\/hostinglabs.net\/asistencia\/wp-json\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/hostinglabs.net\/asistencia\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/hostinglabs.net\/asistencia\/wp-json\/wp\/v2\/comments?post=1186"}],"version-history":[{"count":1,"href":"https:\/\/hostinglabs.net\/asistencia\/wp-json\/wp\/v2\/ht-kb\/1186\/revisions"}],"predecessor-version":[{"id":1187,"href":"https:\/\/hostinglabs.net\/asistencia\/wp-json\/wp\/v2\/ht-kb\/1186\/revisions\/1187"}],"wp:attachment":[{"href":"https:\/\/hostinglabs.net\/asistencia\/wp-json\/wp\/v2\/media?parent=1186"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/hostinglabs.net\/asistencia\/wp-json\/wp\/v2\/ht-kb-category?post=1186"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/hostinglabs.net\/asistencia\/wp-json\/wp\/v2\/ht-kb-tag?post=1186"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}