{"id":4811,"date":"2026-07-19T14:46:05","date_gmt":"2026-07-19T20:46:05","guid":{"rendered":"https:\/\/linuxitos.com\/main\/?p=4811"},"modified":"2026-07-19T14:46:05","modified_gmt":"2026-07-19T20:46:05","slug":"usar-url-directa-en-laravel-13","status":"publish","type":"post","link":"https:\/\/linuxitos.com\/main\/usar-url-directa-en-laravel-13\/","title":{"rendered":"Usar URL directa en Laravel 13"},"content":{"rendered":"\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/linuxitos.com\/main\/wp-content\/uploads\/2026\/07\/image.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"543\" src=\"https:\/\/linuxitos.com\/main\/wp-content\/uploads\/2026\/07\/image-1024x543.png\" alt=\"\" class=\"wp-image-4812\" srcset=\"https:\/\/linuxitos.com\/main\/wp-content\/uploads\/2026\/07\/image-1024x543.png 1024w, https:\/\/linuxitos.com\/main\/wp-content\/uploads\/2026\/07\/image-300x159.png 300w, https:\/\/linuxitos.com\/main\/wp-content\/uploads\/2026\/07\/image-768x407.png 768w, https:\/\/linuxitos.com\/main\/wp-content\/uploads\/2026\/07\/image.png 1337w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<h1 class=\"wp-block-heading\">Contexto:<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">El d\u00eda 24 de febrero del 2025, se lanz\u00f3 la versi\u00f3n 12 de laravel. Un framework con PHP. En lo personal y para versiones en desarrollo, se me facilita m\u00e1s configurar el entorno y el acceso a los proyectos usando XAMPP y usando una url directa, es decir, usar localhost\/nombre-proyecto en lugar de lanzar el proyecto con el comando artisan serve, simplemente porque es m\u00e1s simple.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/laravel.com\">https:\/\/laravel.com<\/a><\/p>\n\n\n\n<h1 class=\"wp-block-heading\">Configuraci\u00f3n<\/h1>\n\n\n\n<h3 class=\"wp-block-heading\">1.- Instalar un proyecto nuevo con el siguiente comando:<\/h3>\n\n\n\n<pre style=\"background: rgb(54, 63, 72); border-radius: 6px; border: 0px; box-sizing: border-box; color: white; font-family: menlo, monaco, monospace; font-style: inherit; font-weight: inherit; line-height: 15.68px; margin-bottom: 1.1em; max-width: 100%; outline: 0px; overflow: auto; padding: 13.125px 16.4062px; vertical-align: baseline; white-space: pre-wrap; word-wrap: break-word;\">composer create-project laravel\/laravel proyecto<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Esperar que termine de descargar los archivos<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">2.- Copiar el archivo index.php del directorio de public\/ y pegarlo en la ruta ra\u00edz del proyecto<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Buscar las l\u00edneas siguientes, y modificar como se muestra:<\/p>\n\n\n\n<pre style=\"background: rgb(245, 245, 245); border-radius: 6px; border: 1px solid rgb(204, 204, 204); box-sizing: border-box; color: #333; font-family: menlo, monaco, monospace; font-style: inherit; font-weight: inherit; line-height: 15.68px; margin-bottom: 1.1em; max-width: 100%; outline: 0px; overflow: auto; padding: 13.125px 16.4062px; vertical-align: baseline; white-space: pre-wrap; word-wrap: break-word;\">[...]\nrequire __DIR__.'\/..\/vendor\/autoload.php';\n\n$app = require_once __DIR__.'\/..\/bootstrap\/app.php';\n[...]\n\nModificar a:\n\n[...]\nrequire __DIR__.'\/vendor\/autoload.php';\n\n$app = require_once __DIR__.'\/bootstrap\/app.php';\n[...]\n\n<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">3.- Crear el archivo .htaccess en el directorio ra\u00edz del proyecto<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code># Disable directory browsing\nOptions All -Indexes\n\n# ----------------------------------------------------------------------\n# Rewrite engine\n# ----------------------------------------------------------------------\n\n# Turning on the rewrite engine is necessary for the following rules and features.\n# FollowSymLinks must be enabled for this to work.\n&lt;IfModule mod_rewrite.c&gt;\n\tOptions +FollowSymlinks\n\tRewriteEngine On\n\n\t# If you installed CodeIgniter in a subfolder, you will need to\n\t# change the following line to match the subfolder you need.\n\t# http:\/\/httpd.apache.org\/docs\/current\/mod\/mod_rewrite.html#rewritebase\n\t# RewriteBase \/\n\n\t# Redirect Trailing Slashes...\n\tRewriteCond %{REQUEST_FILENAME} !-d\n    \tRewriteRule ^(.*)\/$ \/$1 &#91;L,R=301]\n\n\t# Rewrite \"www.example.com -&gt; example.com\"\n\tRewriteCond %{HTTPS} !=on\n\tRewriteCond %{HTTP_HOST} ^www\\.(.+)$ &#91;NC]\n\tRewriteRule ^ http:\/\/%1%{REQUEST_URI} &#91;R=301,L]\n\n\t# Checks to see if the user is attempting to access a valid file,\n    # such as an image or css document, if this isn't true it sends the\n    # request to the front controller, index.php\n\tRewriteCond %{REQUEST_FILENAME} !-f\n\tRewriteCond %{REQUEST_FILENAME} !-d\n\tRewriteRule ^(.*)$ index.php\/$1 &#91;L]\n\n\t# Ensure Authorization header is passed along\n    RewriteCond %{HTTP:Authorization} .\n    RewriteRule .* - &#91;E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]\n&lt;\/IfModule&gt;\n\n&lt;IfModule !mod_rewrite.c&gt;\n    # If we don't have mod_rewrite installed, all 404's\n    # can be sent to index.php, and everything works as normal.\n    ErrorDocument 404 index.php\n&lt;\/IfModule&gt;<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">4.- Asignar permisos a directorios del proyecto, y de storage<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Permisos al proyecto<\/p>\n\n\n\n<pre style=\"background: rgb(54, 63, 72); border-radius: 6px; border: 0px; box-sizing: border-box; color: white; font-family: menlo, monaco, monospace; font-style: inherit; font-weight: inherit; line-height: 15.68px; margin-bottom: 1.1em; max-width: 100%; outline: 0px; overflow: auto; padding: 13.125px 16.4062px; vertical-align: baseline; white-space: pre-wrap; word-wrap: break-word;\">sudo chmod 775 -R proyecto<\/pre>\n\n\n\n<pre style=\"background: rgb(54, 63, 72); border-radius: 6px; border: 0px; box-sizing: border-box; color: white; font-family: menlo, monaco, monospace; font-style: inherit; font-weight: inherit; line-height: 15.68px; margin-bottom: 1.1em; max-width: 100%; outline: 0px; overflow: auto; padding: 13.125px 16.4062px; vertical-align: baseline; white-space: pre-wrap; word-wrap: break-word;\">sudo chown -R daemon:blip proyecto<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Permisos a storage<\/p>\n\n\n\n<pre style=\"background: rgb(54, 63, 72); border-radius: 6px; border: 0px; box-sizing: border-box; color: white; font-family: menlo, monaco, monospace; font-style: inherit; font-weight: inherit; line-height: 15.68px; margin-bottom: 1.1em; max-width: 100%; outline: 0px; overflow: auto; padding: 13.125px 16.4062px; vertical-align: baseline; white-space: pre-wrap; word-wrap: break-word;\">sudo chmod 777 proyecto\/storage -R<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">5.- Acceder a la URL del proyecto desde el navegador<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"http:\/\/localhost\/proyecto\">http:\/\/localhost\/proyecto<\/a><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/linuxitos.com\/main\/wp-content\/uploads\/2026\/07\/image-1.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"543\" src=\"https:\/\/linuxitos.com\/main\/wp-content\/uploads\/2026\/07\/image-1-1024x543.png\" alt=\"\" class=\"wp-image-4813\" srcset=\"https:\/\/linuxitos.com\/main\/wp-content\/uploads\/2026\/07\/image-1-1024x543.png 1024w, https:\/\/linuxitos.com\/main\/wp-content\/uploads\/2026\/07\/image-1-300x159.png 300w, https:\/\/linuxitos.com\/main\/wp-content\/uploads\/2026\/07\/image-1-768x407.png 768w, https:\/\/linuxitos.com\/main\/wp-content\/uploads\/2026\/07\/image-1.png 1337w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Gracias por visitar.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Contexto: El d\u00eda 24 de febrero del 2025, se lanz\u00f3 la versi\u00f3n 12 de laravel. Un framework con PHP. En lo personal y para versiones en desarrollo, se me facilita m\u00e1s configurar el entorno y el acceso a los proyectos usando XAMPP y usando una url directa, es decir, usar localhost\/nombre-proyecto en lugar de lanzar [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":4812,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[167,1127,1003,7],"tags":[2056,1638,1587],"class_list":["post-4811","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-actualizar-phpmyadmin-de-xampp","category-agregar-proyecto-a-xampp","category-change-port-for-xampp","category-fedora","tag-directo-index","tag-laravel","tag-xampp"],"_links":{"self":[{"href":"https:\/\/linuxitos.com\/main\/wp-json\/wp\/v2\/posts\/4811","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxitos.com\/main\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxitos.com\/main\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxitos.com\/main\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxitos.com\/main\/wp-json\/wp\/v2\/comments?post=4811"}],"version-history":[{"count":1,"href":"https:\/\/linuxitos.com\/main\/wp-json\/wp\/v2\/posts\/4811\/revisions"}],"predecessor-version":[{"id":4814,"href":"https:\/\/linuxitos.com\/main\/wp-json\/wp\/v2\/posts\/4811\/revisions\/4814"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxitos.com\/main\/wp-json\/wp\/v2\/media\/4812"}],"wp:attachment":[{"href":"https:\/\/linuxitos.com\/main\/wp-json\/wp\/v2\/media?parent=4811"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxitos.com\/main\/wp-json\/wp\/v2\/categories?post=4811"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxitos.com\/main\/wp-json\/wp\/v2\/tags?post=4811"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}