0

Hola tengo un problema a en una web local (XAMPP) en el cual al crear el MVC de php tengo las vistas y controladores estructurados por carpetas. La cosa es que en mi raiz tengo un index.php que redirige dentro de la carpeta "pages" a la entrada de la web.

Como consecuencia la url a día de hoy es localhost/pages/red.php y me gustaría mostrar solo localhost/red, luego la siguente es localhost/step-x y quisiera cambiarlo por localhost/datos por ejemplo.

El htacces no me está haciendo caso (cuando pongo un 404 o así si) este es mi codigo:

RewriteEngine On
Rewritebase /
RewriteRule ^red(/.*|$) pages/red.php [NC,END]

Tengo cambiada la config del apache de XAMPP para que me ponga la web por default quedando así:

DocumentRoot "C:/xampp/htdocs/maqueta"
<Directory "C:/xampp/htdocs/maqueta">
    #
    # Possible values for the Options directive are "None", "All",
    # or any combination of:
    #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    #
    # Note that "MultiViews" must be named *explicitly* --- "Options All"
    # doesn't give it to you.
    #
    # The Options directive is both complicated and important.  Please see
    # http://httpd.apache.org/docs/2.4/mod/core.html#options
    # for more information.
    #
    Options Indexes FollowSymLinks Includes ExecCGI

    #
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    #   AllowOverride FileInfo AuthConfig Limit
    #
    AllowOverride All
    Allow from All
    #
    # Controls who can get stuff from this server.
    #
    Require all granted
</Directory>
3
  • Hola, ¿dónde pusiste el archivo .htacces?, ya que si quieres que funcione con la dirección del localhost/ entonces deberías modificar el .htacces de la raíz de los proyectos, en XAMP sería xampp/htdocs el 19 feb. 2021 a las 19:25
  • No se si es ahí donde debería ir, cambie la configuracion del XAMPP para que "localhost" apuntase a mi sitio (por el tema de ajax y scripts me era más comodo). Te actualizo la información
    – Voxxii
    el 20 feb. 2021 a las 11:26
  • Por lo que veo, tu archivo debe estar ubicado en "C:/xampp/htdocs/maqueta/.htaccess" el 22 feb. 2021 a las 19:51

0

Tu Respuesta

By clicking “Publica tu respuesta”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Examina otras preguntas con la etiqueta o formula tu propia pregunta.