Foros del Web » Soporte técnico » Ayuda General »

RewriteCond en .htaccess

Estas en el tema de RewriteCond en .htaccess en el foro de Ayuda General en Foros del Web. Hola, necesito ayuda como utilizaria RewriteCond en .htaccess El problema tengo con una aplicación llamada J!whmcs integrator me tira el siguiente error 403 received with ...
  #1 (permalink)  
Antiguo 17/11/2015, 09:31
Avatar de luzzifer  
Fecha de Ingreso: julio-2009
Ubicación: Paraná - Argentina
Mensajes: 169
Antigüedad: 14 años, 9 meses
Puntos: 3
Pregunta RewriteCond en .htaccess

Hola, necesito ayuda como utilizaria RewriteCond en .htaccess

El problema tengo con una aplicación llamada J!whmcs integrator me tira el siguiente error 403 received with URL y en el soporte me dicen lo siguiente
Cita:
Their WHMCS was setup as a subfolder within their site (so Joomla was in the root, then WHMCS in a subfolder). They had enabled the Joomla .htaccess file, and at the end of the file there was a call to force all requests that have not yet been routed by the .htaccess file to receive a 403 response. When disabling the .htaccess file, the API connected right up. To fix in this particular case, I added a RewriteCond to exclude requests to the subfolder and it worked from there on.
Traducido en google
Cita:
Su WHMCS fue instalado como una subcarpeta dentro de su sitio (para Joomla estaba en la raíz, entonces WHMCS en una subcarpeta). Habían permitido el archivo .htaccess Joomla, y al final del archivo no era una llamada para obligar a todas las solicitudes que aún no han sido derrotados por el archivo .htaccess para recibir una respuesta 403. Al desactivar el archivo .htaccess, el API conectado enseguida. Para solucionar en este caso particular, he añadido un RewriteCond excluir las solicitudes a la subcarpeta y funcionó a partir de ahí.
Los detalles: Tengo instalado joomla en la carpeta /public_html/ y whmcs dentro de ella osea quedaría asi /public_html/whmcs/ y creo que eso me esta dando el error al sincronizar el componente. Por eso recibí esa respuesta del soporte técnico.

La duda que tengo: ¿Es como haria esto que me pide así no anulo el .htaccess ?
Cita:
I added a RewriteCond to exclude requests to the subfolder and it worked from there on
  #2 (permalink)  
Antiguo 18/11/2015, 07:38
AlvaroG
Invitado
 
Mensajes: n/a
Puntos:
Respuesta: RewriteCond en .htaccess

Esta es una pregunta de Apache, reporto el tema para que sea movido al foro correcto.

Para saber exactamente qué debes agregar habría que ver tu archivo .htaccess actual, pero me da la idea de que el archivo ya tiene cosas como

RewriteCond ....
RewriteCond ...
Redirect ....

y lo que hay que hacer es agregar un RewriteCond allí para que "sepa" qué hacer cuando una URL incluye tu carpeta de WHMCS
  #3 (permalink)  
Antiguo 18/11/2015, 07:43
Avatar de luzzifer  
Fecha de Ingreso: julio-2009
Ubicación: Paraná - Argentina
Mensajes: 169
Antigüedad: 14 años, 9 meses
Puntos: 3
Respuesta: RewriteCond en .htaccess

Hola gracias, y disculpa que haya publicado en una categoría que no era la indicada.
Código Apache:
Ver original
  1. ##
  2. # @package      Joomla
  3. # @copyright    Copyright (C) 2005 - 2013 Open Source Matters. All rights reserved.
  4. # @license      GNU General Public License version 2 or later; see LICENSE.txt
  5. ##
  6.  
  7. RewriteEngine On
  8. RewriteCond %{HTTP_HOST} ^MYSITE.com
  9. RewriteRule (.*) http://www.MYSITE.com/$1 [R=301,L]
  10.  
  11. ##
  12. # READ THIS COMPLETELY IF YOU CHOOSE TO USE THIS FILE!
  13. #
  14. # The line just below this section: 'Options +FollowSymLinks' may cause problems
  15. # with some server configurations.  It is required for use of mod_rewrite, but may already
  16. # be set by your server administrator in a way that dissallows changing it in
  17. # your .htaccess file.  If using it causes your server to error out, comment it out (add # to
  18. # beginning of line), reload your site in your browser and test your sef url's.  If they work,
  19. # it has been set by your server administrator and you do not need it set here.
  20. ##
  21.  
  22. ## Can be commented out if causes errors, see notes above.
  23. Options +FollowSymLinks
  24.  
  25. ## Mod_rewrite in use.
  26.  
  27. RewriteEngine On
  28.  
  29. ## Begin - Rewrite rules to block out some common exploits.
  30. # If you experience problems on your site block out the operations listed below
  31. # This attempts to block the most common type of exploit `attempts` to Joomla!
  32. #
  33. # Block out any script trying to base64_encode data within the URL.
  34. RewriteCond %{QUERY_STRING} base64_encode[^(]*\([^)]*\) [OR]
  35. # Block out any script that includes a <script> tag in URL.
  36. RewriteCond %{QUERY_STRING} (<|%3C)([^s]*s)+cript.*(>|%3E) [NC,OR]
  37. # Block out any script trying to set a PHP GLOBALS variable via URL.
  38. RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
  39. # Block out any script trying to modify a _REQUEST variable via URL.
  40. RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
  41. # Return 403 Forbidden header and show the content of the root homepage
  42. RewriteRule .* index.php [F]
  43. #
  44. ## End - Rewrite rules to block out some common exploits.
  45.  
  46. ## Begin - Custom redirects
  47. #
  48. # If you need to redirect some pages, or set a canonical non-www to
  49. # www redirect (or vice versa), place that code here. Ensure those
  50. # redirects use the correct RewriteRule syntax and the [R=301,L] flags.
  51. #
  52. ## End - Custom redirects
  53.  
  54. ##
  55. # Uncomment following line if your webserver's URL
  56. # is not directly related to physical file paths.
  57. # Update Your Joomla! Directory (just / for root).
  58. ##
  59.  
  60. # RewriteBase /
  61.  
  62. ## Begin - Joomla! core SEF Section.
  63. #
  64. RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
  65. #
  66. # If the requested path and file is not /index.php and the request
  67. # has not already been internally rewritten to the index.php script
  68. RewriteCond %{REQUEST_URI} !^/index\.php
  69. # and the request is for something within the component folder,
  70. # or for the site root, or for an extensionless URL, or the
  71. # requested URL ends with one of the listed extensions
  72. RewriteCond %{REQUEST_URI} /component/|(/[^.]*|\.(php|html?|feed|pdf|vcf|raw))$ [NC]
  73. # and the requested path and file doesn't directly match a physical file
  74. RewriteCond %{REQUEST_FILENAME} !-f
  75. # and the requested path and file doesn't directly match a physical folder
  76. RewriteCond %{REQUEST_FILENAME} !-d
  77. # internally rewrite the request to the index.php script
  78. RewriteRule .* index.php [L]
  79. #
  80. ## End - Joomla! core SEF Section.

Etiquetas: htaccess, rewritecond
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.
Respuesta




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