Cómo detener el bucle .htaccess
No soy experto en archivos htaccess y estoy intentando algo que parece muy simple pero no he podido hacerlo.
Busqué y finalmente encontré que algo aquí podría funcionar para mi uso, pero no lo hizo. El código está abajo.
Aquí hay un ejemplo de lo que necesito:
http://localhost/Test/TestScript.php
para mostrar esto:http://localhost/Test/TestScript/
Con guión en lugar original.
Estas son mis reglas (Copiado):
Options +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /Test
## hide .php extension
# To externally redirect /dir/foo.php to /dir/foo
RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s([^.]+)\.php [NC]
RewriteRule ^ %1 [R,L,NC]
## To internally forward /dir/foo to /dir/foo.php
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^ %{REQUEST_FILENAME}.php [L]
Esta regla da:
Forbidden You don't have permission to access ".../Test/TestScript.php on this server."
Así cambió la última línea a:
RewriteRule ^.* http://localhost/Test/TestScript.php [L]
Pero ahora recibe este error:
The page isn't redirecting properly
Espero que gente brillante en este lugar me pueda ayudar. Gracias.