Foros del Web » Creando para Internet » Sistemas de gestión de contenidos » Joomla »

duda con .htaccess para sh404sef

Estas en el tema de duda con .htaccess para sh404sef en el foro de Joomla en Foros del Web. Hola!, quiero implementar el sh404sef en un sitio web pero he visto 2 versiones distintas refiriendose a la configuracion que ha de tener el archivo ...
  #1 (permalink)  
Antiguo 06/08/2009, 13:01
 
Fecha de Ingreso: julio-2009
Mensajes: 13
Antigüedad: 14 años, 9 meses
Puntos: 0
duda con .htaccess para sh404sef

Hola!, quiero implementar el sh404sef en un sitio web pero he visto 2 versiones distintas refiriendose a la configuracion que ha de tener el archivo .htaccess.

La primera, sacada de este mismo foro es:

Código:
Options +FollowSymLinks

#
#  mod_rewrite in use

RewriteEngine On


#  Uncomment following line if your webserver's URL
#  is not directly related to physical file paths.
#  Update Your Joomla!/MamboDirectory (just / for root)

# RewriteBase /


########## Begin - Joomla! core SEF Section
############# Use this section if using ONLY Joomla! core SEF
## ALL (RewriteCond) lines in this section are only required if you actually
## have directories named 'content' or 'component' on your server
## If you do not have directories with these names, comment them out.
#
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
#RewriteCond %{REQUEST_URI} ^(/component/option,com) [NC,OR] 		##optional - see notes##
RewriteCond %{REQUEST_URI} (/|\.htm|\.php|\.html|/[^.]*)$  [NC]
RewriteRule ^(content/|component/) index.php
#
########## End - Joomla! core SEF Section



########## Begin - 3rd Party SEF Section
############# Use this section if you are using a 3rd party (Non Joomla! core) SEF extension - e.g. OpenSEF, 404_SEF, 404SEFx, SEF Advance, etc
#
RewriteCond %{REQUEST_URI} ^(/component/option,com) [NC,OR] ##optional - see notes##
RewriteCond %{REQUEST_URI} (/|\.htm|\.php|\.html|/[^.]*)$ [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) index.php
#
########## End - 3rd Party SEF Section



########## Begin - Rewrite rules to block out some common exploits
## If you experience problems on your site block out the operations listed below
## This attempts to block the most common type of exploit `attempts` to Joomla!
#
# Block out any script trying to set a mosConfig value through the URL
RewriteCond %{QUERY_STRING} mosConfig_[a-zA-Z_]{1,21}(=|\%3D) [OR]
# Block out any script trying to base64_encode crap to send via URL
RewriteCond %{QUERY_STRING} base64_encode.*\(.*\) [OR]
# Block out any script that includes a <script> tag in URL
RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]
# Block out any script trying to set a PHP GLOBALS variable via URL
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
# Block out any script trying to modify a _REQUEST variable via URL
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
# Send all blocked request to homepage with 403 Forbidden error!
RewriteRule ^(.*)$ index.php [F,L]
#
########## End - Rewrite rules to block out some common exploits
La segunda, de otro sitio en internet:

Código:
RewriteBase /

########## Begin – Joomla! core SEF Section
############# Use this section if using ONLY Joomla! core SEF
## ALL (RewriteCond) lines in this section are only required if you actually
## have directories named ‘content’ or ‘component’ on your server
## If you do not have directories with these names, comment them out.
#
#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteCond %{REQUEST_FILENAME} !-d
#RewriteCond %{REQUEST_URI} ^(/component/option,com) [NC,OR] ##optional – see notes##
#RewriteCond %{REQUEST_URI} (/|\.htm|\.php|\.html|/[^.]*)$ [NC]
#RewriteRule ^(content/|component/) index.php
#
########## End – Joomla! core SEF Section

########## Begin – 3rd Party SEF Section
############# Use this section if you are using a 3rd party (Non Joomla! core) SEF extension – e.g. OpenSEF, 404_SEF, 404SEFx, SEF Advance, etc
#
RewriteCond %{REQUEST_URI} ^(/component/option,com) [NC,OR] ##optional – see notes##
RewriteCond %{REQUEST_URI} (/|\.htm|\.php|\.html|/[^.]*)$ [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) index.php
#
########## End – 3rd Party SEF Section
En una se mantiene sin comentar el Joomla core SEF y en la otra la comentan, ¿como debo dejarlo y por qué?. Gracias :)
  #2 (permalink)  
Antiguo 12/08/2009, 12:20
 
Fecha de Ingreso: julio-2009
Mensajes: 13
Antigüedad: 14 años, 9 meses
Puntos: 0
Respuesta: duda con .htaccess para sh404sef

¿nadie? :(
  #3 (permalink)  
Antiguo 12/08/2009, 17:19
Avatar de Larenz
Colaborador
 
Fecha de Ingreso: enero-2007
Ubicación: Nicaragua
Mensajes: 1.398
Antigüedad: 17 años, 3 meses
Puntos: 55
Respuesta: duda con .htaccess para sh404sef

Jajaja ok... te doy una ayudadita. Había visto este post pero pensé que alguien más podía contestar ya que no tengo tiempo para contestarle a todo mundo tomaré un poco para ayudarte.

Este es el código:

Código:
##
# @version $Id: htaccess.txt 10492 2008-07-02 06:38:28Z ircmaxell $
# @package Joomla
# @copyright Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.
# @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
# Joomla! is Free Software
##


#####################################################
#  READ THIS COMPLETELY IF YOU CHOOSE TO USE THIS FILE
#
# The line just below this section: 'Options +FollowSymLinks' may cause problems
# with some server configurations.  It is required for use of mod_rewrite, but may already
# be set by your server administrator in a way that dissallows changing it in
# your .htaccess file.  If using it causes your server to error out, comment it out (add # to
# beginning of line), reload your site in your browser and test your sef url's.  If they work,
# it has been set by your server administrator and you do not need it set here.
#
#####################################################

##  Can be commented out if causes errors, see notes above.
Options +FollowSymLinks

#
#  mod_rewrite in use

RewriteEngine On

########## Begin - Rewrite rules to block out some common exploits
## If you experience problems on your site block out the operations listed below
## This attempts to block the most common type of exploit `attempts` to Joomla!
#
# Block out any script trying to set a mosConfig value through the URL
RewriteCond %{QUERY_STRING} mosConfig_[a-zA-Z_]{1,21}(=|\%3D) [OR]
# Block out any script trying to base64_encode crap to send via URL
RewriteCond %{QUERY_STRING} base64_encode.*\(.*\) [OR]
# Block out any script that includes a <script> tag in URL
RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]
# Block out any script trying to set a PHP GLOBALS variable via URL
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
# Block out any script trying to modify a _REQUEST variable via URL
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
# Send all blocked request to homepage with 403 Forbidden error!
RewriteRule ^(.*)$ index.php [F,L]
#
########## End - Rewrite rules to block out some common exploits

#  Uncomment following line if your webserver's URL
#  is not directly related to physical file paths.
#  Update Your Joomla! Directory (just / for root)

# RewriteBase /


########## Begin - Joomla! core SEF Section
#
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/index.php
RewriteCond %{REQUEST_URI} (/|\.php|\.html|\.htm|\.feed|\.pdf|\.raw|/[^.]*)$  [NC]
RewriteRule (.*) index.php
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
#
########## End - Joomla! core SEF Section
-> ¿Qué hacer con este código?

1- Lo copias y lo pegas en un archivo y lo renombras a .htaccess
2- Lo vas a pegar en el directorio raíz de tus archivos Joomla.

-> ¿Qué puede pasar?

Si tu servidor tiene activado el mod_rewrite para sobreescribir url puede que te de un error 505, o que la web te quede en blanco, deje de funcionar, etc. Entonces de ser así lo soluciones comentando lo siguiente en el código:

-> Vas a buscar en el código de arriba lo siguiente: Options +FollowSymLinks y lo vas a comentar quedando de la siguiente forma:

Código:
#Options +FollowSymLinks
Eso es todo lo que necesitas hacer para poner a funcionar el sh404SEF de Joomla.

¿Más claro? naaa.... no lo creo, ¿verdad?
  #4 (permalink)  
Antiguo 15/08/2009, 15:05
 
Fecha de Ingreso: julio-2009
Mensajes: 13
Antigüedad: 14 años, 9 meses
Puntos: 0
Respuesta: duda con .htaccess para sh404sef

Cita:
Iniciado por Larenz Ver Mensaje
Jajaja ok... te doy una ayudadita. Había visto este post pero pensé que alguien más podía contestar ya que no tengo tiempo para contestarle a todo mundo tomaré un poco para ayudarte.

Este es el código:

Código:
##
# @version $Id: htaccess.txt 10492 2008-07-02 06:38:28Z ircmaxell $
# @package Joomla
# @copyright Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.
# Joomla! is Free Software
##


#####################################################
#  READ THIS COMPLETELY IF YOU CHOOSE TO USE THIS FILE
#
# The line just below this section: 'Options +FollowSymLinks' may cause problems
# with some server configurations.  It is required for use of mod_rewrite, but may already
# be set by your server administrator in a way that dissallows changing it in
# your .htaccess file.  If using it causes your server to error out, comment it out (add # to
# beginning of line), reload your site in your browser and test your sef url's.  If they work,
# it has been set by your server administrator and you do not need it set here.
#
#####################################################

##  Can be commented out if causes errors, see notes above.
Options +FollowSymLinks

#
#  mod_rewrite in use

RewriteEngine On

########## Begin - Rewrite rules to block out some common exploits
## If you experience problems on your site block out the operations listed below
## This attempts to block the most common type of exploit `attempts` to Joomla!
#
# Block out any script trying to set a mosConfig value through the URL
RewriteCond %{QUERY_STRING} mosConfig_[a-zA-Z_]{1,21}(=|\%3D) [OR]
# Block out any script trying to base64_encode crap to send via URL
RewriteCond %{QUERY_STRING} base64_encode.*\(.*\) [OR]
# Block out any script that includes a <script> tag in URL
RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]
# Block out any script trying to set a PHP GLOBALS variable via URL
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
# Block out any script trying to modify a _REQUEST variable via URL
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
# Send all blocked request to homepage with 403 Forbidden error!
RewriteRule ^(.*)$ index.php [F,L]
#
########## End - Rewrite rules to block out some common exploits

#  Uncomment following line if your webserver's URL
#  is not directly related to physical file paths.
#  Update Your Joomla! Directory (just / for root)

# RewriteBase /


########## Begin - Joomla! core SEF Section
#
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/index.php
RewriteCond %{REQUEST_URI} (/|\.php|\.html|\.htm|\.feed|\.pdf|\.raw|/[^.]*)$  [NC]
RewriteRule (.*) index.php
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
#
########## End - Joomla! core SEF Section
-> ¿Qué hacer con este código?

1- Lo copias y lo pegas en un archivo y lo renombras a .htaccess
2- Lo vas a pegar en el directorio raíz de tus archivos Joomla.

-> ¿Qué puede pasar?

Si tu servidor tiene activado el mod_rewrite para sobreescribir url puede que te de un error 505, o que la web te quede en blanco, deje de funcionar, etc. Entonces de ser así lo soluciones comentando lo siguiente en el código:

-> Vas a buscar en el código de arriba lo siguiente: Options +FollowSymLinks y lo vas a comentar quedando de la siguiente forma:

Código:
#Options +FollowSymLinks
Eso es todo lo que necesitas hacer para poner a funcionar el sh404SEF de Joomla.

¿Más claro? naaa.... no lo creo, ¿verdad?
gracias larenz por tu respuesta, la única duda que me queda es: La parte del 3rd party SEF Section no se toma en cuenta entonces?

eso, y gracias ^^
  #5 (permalink)  
Antiguo 15/08/2009, 16:55
Avatar de Larenz
Colaborador
 
Fecha de Ingreso: enero-2007
Ubicación: Nicaragua
Mensajes: 1.398
Antigüedad: 17 años, 3 meses
Puntos: 55
Respuesta: duda con .htaccess para sh404sef

Eso sirve nomás para configuraciones. Pero con lo que te dije el componente ya debería de estar funcionando con las url dinámicas
  #6 (permalink)  
Antiguo 16/08/2009, 16:32
 
Fecha de Ingreso: julio-2009
Mensajes: 13
Antigüedad: 14 años, 9 meses
Puntos: 0
Respuesta: duda con .htaccess para sh404sef

bueno lo probé y arruinó el sitio =(, me lanzaba errores 404 en todas las paginas aunque comentara el option symlinks, luego me lanzaba erroes 403 e el administrator lo cual termino por botar el sitio :S
  #7 (permalink)  
Antiguo 16/08/2009, 18:12
Avatar de Larenz
Colaborador
 
Fecha de Ingreso: enero-2007
Ubicación: Nicaragua
Mensajes: 1.398
Antigüedad: 17 años, 3 meses
Puntos: 55
Respuesta: duda con .htaccess para sh404sef

Mal configurastes el componente. ¿Ya probastes la configuración de tu administrador de Joomla? Tienes que hacerlo mediante la siguiente ruta:

Sitio->Configuración Global->Usar Apache mod_rewrite: Sí
  #8 (permalink)  
Antiguo 16/08/2009, 21:37
 
Fecha de Ingreso: julio-2009
Mensajes: 13
Antigüedad: 14 años, 9 meses
Puntos: 0
Respuesta: duda con .htaccess para sh404sef

Cita:
Iniciado por Larenz Ver Mensaje
Mal configurastes el componente. ¿Ya probastes la configuración de tu administrador de Joomla? Tienes que hacerlo mediante la siguiente ruta:

Sitio->Configuración Global->Usar Apache mod_rewrite: Sí
Gracias Larenz por tus prontas respuestas, al parecer no he configurado aquello, lo unico que me suena es el haber activado las url amigables para buscadores. Ahora estoy esperando a que me desbloqueen la dirección IP desde el hosting para poder ingresar al sitio. Lo raro es que cuando quería modificar algo del componente, me lanzaba este error 403. Luego les cuento que ha ocurrido con esto.
  #9 (permalink)  
Antiguo 17/08/2009, 10:36
 
Fecha de Ingreso: julio-2009
Mensajes: 13
Antigüedad: 14 años, 9 meses
Puntos: 0
Respuesta: duda con .htaccess para sh404sef

dicha opcion no me sale, estoy usando joomla 1.0.5 y la unic opcion que hace referencia a apache es la de url amigables para buscadores.
  #10 (permalink)  
Antiguo 17/08/2009, 21:42
Avatar de Larenz
Colaborador
 
Fecha de Ingreso: enero-2007
Ubicación: Nicaragua
Mensajes: 1.398
Antigüedad: 17 años, 3 meses
Puntos: 55
Respuesta: duda con .htaccess para sh404sef

Ohhhhhh!!! Puede que por eso el archivo .htacces no complemente con la versión de Joomla que estás usando. Déjame decirte que estás trabajando en vano en esa versión de Joomla. Todavía no concibo cómo es posible que uses la versión 1.0.5 de Joomla, WOW!!!

Debes de actualizarte a la versión 1.5.14. Los datos que te pasé están basados en una versión de Joomla 1.5.x
  #11 (permalink)  
Antiguo 15/07/2010, 13:09
 
Fecha de Ingreso: marzo-2009
Mensajes: 1
Antigüedad: 15 años, 1 mes
Puntos: 0
De acuerdo Respuesta: duda con .htaccess para sh404sef

Goooooooooooooood Excelente respuesta te felicito de verdad, hace rato que hacia falta una explicacion concreta, a mi me funciono perfectamente.....

NO olviden renombrar el archivo htaccess.txt a .htaccess con el punto y todo si no no
funciona.

De resto sigan las instrucciones de Larenz, si tienen dudas me avisan, yo pelié dos dias jajajajaja y la falla era el puntito.

Gracias LARENZ
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Tema Cerrado




La zona horaria es GMT -6. Ahora son las 02:09.