Okay there is 2 questions,
First, I'm new with htaccess and have a lot of problem figure out how to make good Rewrited URL for google SEO so i've made this :
Options +FollowSymlinks
RewriteEngine on
### [... other language ...]
### English product URL
# Product page : (url/en/products/items-1.html)
RewriteRule ^([a-z]+)/[P-p]roducts/item-([0-9]+)\.html$ produits.php?lang=$1&art=$2 [L,NC]
# List of categories of a division (url/en/products/items-1-1.html)
RewriteRule ^([a-z]+)/[P-p]roducts/item-([0-9]+)-([0-9]+)\.html$ produits.php?lang=$1&idc=$2&catd=$3 [L,NC]
# List of subcategories of a categorie (url/en/products/items-1-1-1.html)
RewriteRule ^([a-z]+)/[P-p]roducts/item-([0-9]+)-([0-9]+)-([0-9]+)\.html$ produits.php?lang=$1&idc=$2&catd=$3&catt=$4 [L,NC]
# List of sub-sub-categories of a sub-categorie (url/en/products/items-1-1-1-1.html)
RewriteRule ^([a-z]+)/[P-p]roducts/item-([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)\.html$ produits.php?lang=$1&idc=$2&catd=$3&catt=$4&catq=$5 [L,NC]
### Mod Rewrite to make url more friendly EN
RewriteRule ^([a-z]+)/[B-b]ecome-a-[C-c]lient client.php?lang=$1 [L,NC]
RewriteRule ^([a-z]+)/[C-c]ontact-[U-u]s contact.php?lang=$1 [L,NC]
RewriteRule ^([a-z]+)/[O-o]ops erreur.php?lang=$1 [L,NC]
RewriteRule ^([a-z]+)/[I-i]ndustrial-[D-d]ivision industriel.php?lang=$1 [L,NC]
RewriteRule ^([a-z]+)/[C-c]art panier.php?lang=$1 [L,NC]
RewriteRule ^([a-z]+)/[S-s]earch recherche.php?lang=$1 [L,NC]
RewriteRule ^([a-z]+)/[H-h]ealt-[D-d]ivision sanitaire.php?lang=$1 [L,NC]
RewriteRule ^([a-z]+)/[H-h]ome index.php?lang=$1 [L,NC]
### Compression Mod
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/php
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
## [... errors page ...]
The problem now is that if I would reach something for developpement purpose I can't do it
Exemple : I copy the whole website into a folder named work a the root of the domain so the url would be
www.website-url.com/work
at this point everything is fine I can access this part, but if I would access products.php I just can do it... I know that I can't reach it with the rewrite like www.website-url.com/work/products/items-1.html but I should be able to access it directly no ?
My second questions is that I would use compression for my server to make the website load more faster for client because I have a lot of javascipt working with jQuery a lot. But I can't make it work, I've checked with online tools and never pass compression test.
Thanks for your help !
Related
I'm currently hosting a PHP application on Apache. This application is behind a CloudFront distribution that sends all requests with cms/* to my application.
I used the following .htaccess file and hoped to make things work:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /cms
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*) index.php [L]
</IfModule>
SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE text/javascript
AddOutputFilterByType DEFLATE application/json
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
</IfModule>
I get an Internal Server Error and in the Apache Error logs this can be found:
AH00124: Request exceeded the limit of 10 internal redirects due to probable configuration error.
What am I doing wrong?
My CMS is running in the document root of the Apache server.
If the CMS is in the document root then you should remove the RewriteBase /cms directive entirely.
The presence of RewriteBase /cms results in the request being internally rewritten to /cms/index.php (not /index.php) and if this file does not exist then you will naturally get a rewrite-loop (the preceding condition checks that the request does not map to a file or directory).
In other words (with some additional improvements):
DirectoryIndex index.php
RewriteEngine on
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php [L]
DirectoryIndex is likely already set in the server config, although it is necessary here.
The first RewriteRule directive is an optimization to prevent unnecessary filesystem checks when the request is rewritten.
There is no need to traverse and capture the entire URL-path in the last RewriteRule directive (ie. ^(.*)). The regex . (a single dot) is sufficient, and more efficient.
No need for the <IfModule mod_rewrite.c> wrapper, unless these directives are optional.
I solved it the following way:
I put the application on the Apache server in a cms folder and kept the current .htaccess as is. It might also work with keeping it in the Apache root folder and setting the RewriteBase to something like ../ if that works with Apache but I'm happy with the current solution.
I want to force .php extension from htaccess, because someone changed it and now all my URLs give 404 error. Can somebody help me? If you wanna I can publish the .htaccess. I've also tried Mike solution, but everything stays without .php extension and 404 error.
Also i tried to modify it from the PHP archives but the same error appears.
# It is required for use of mod_rewrite, but may already be set by your server administrator in a way that dissallows ...
Options +FollowSymLinks
Options -MultiViews
# Redirect to .php
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^ %{REQUEST_URI}.php [R=301,L]
# Mod_rewrite in use.
RewriteEngine On
# Mod_rewrite in use.
RewriteEngine On
# SEGUIMOS
Redirect 301 /si-no-queda-satisfecho-le-devolvemos-el-dinero.html https://www.academiapinto.es/otros-enlaces/si-no-queda-satisfecho-le-devolvemos-el-dinero.php
Redirect 301 /si-no-queda-satisfecho-le-devolvemos-el-dinero.php https://www.academiapinto.es/otros-enlaces/si-no-queda-satisfecho-le-devolvemos-el-dinero.php
# Redirect 301 / https://www.academiapinto.es/
#parche POLILLA
Redirect 301 /temario-Guardias-Jovenes-(Polillas).php https://www.academiapinto.es/oposiciones-de-ingreso-Colegio-Guardias-Jovenes-Duque-de-Ahumada.php
Redirect 301 /blog-academia-pinto-para-preparar-tus-oposiciones-para-la-PN.php https://www.academiapinto.es/blog/articulo-academia-pinto-para-preparar-tus-oposiciones-para-la-PN.php
Redirect 301 /blog-camino-a-baeza.php https://www.academiapinto.es/blog/articulo-camino-a-baeza.php
Redirect 301 /blog-como-seleccionar-una-buena-academia-de-oposiciones-para-guardia-civil-y-policia-nacional.php https://www.academiapinto.es/blog/articulo-como-seleccionar-una-buena-academia-de-oposiciones-para-guardia-civil-y-policia-nacional.php
Redirect 301 /blog-dime-como-estudias.php https://www.academiapinto.es/blog/articulo-dime-como-estudias.php
Redirect 301 /blog-documentacion-instancia-oposicion-ingreso-a-la-guardia-civil.php https://www.academiapinto.es/blog/articulo-documentacion-instancia-oposicion-ingreso-a-la-guardia-civil.php
Redirect 301 /blog-llego-la-hora.php https://www.academiapinto.es/blog/articulo-llego-la-hora.php
Redirect 301 /blog-primer-concurso-de-fotografia.php https://www.academiapinto.es/blog/articulo-primer-concurso-de-fotografia.php
Redirect 301 /blog-psicotecnicos-recomendaciones-necesarias.php https://www.academiapinto.es/blog/articulo-psicotecnicos-recomendaciones-necesarias.php
Redirect 301 /blog-que-no-puedes-olvidar-en-tu-examen-para-la-guardia-civil.php https://www.academiapinto.es/blog/articulo-que-no-puedes-olvidar-en-tu-examen-para-la-guardia-civil.php
Redirect 301 /blog-tecnicas-de-estudio-para-aprobar-las-oposiciones-de-gc.php https://www.academiapinto.es/blog/articulo-tecnicas-de-estudio-para-aprobar-las-oposiciones-de-gc.php
Redirect 301 /blog-tienes-la-documentacion.php https://www.academiapinto.es/blog/articulo-tienes-la-documentacion.php
Redirect 301 /noticia-Academia-Pinto-incrementa-las-horas-de-clases-online.php https://www.academiapinto.es/news/noticia-Academia-Pinto-incrementa-las-horas-de-clases-online.php
Redirect 301 /noticia-instrucciones-rellenar-instancia-ingreso-guardia-civil.php https://www.academiapinto.es/news/noticia-instrucciones-rellenar-instancia-ingreso-guardia-civil.php
Redirect 301 /noticia-oferta-curso-online-ingreso-Guardia-Civil.php https://www.academiapinto.es/news/noticia-oferta-curso-online-ingreso-Guardia-Civil.php
# las de los empleos
Redirect 301 /curso-a-distancia-ingreso-guardia-civil https://www.academiapinto.es/temario-de-ingreso-guardia-civil.php
Redirect 301 /curso-a-distancia-ingreso-policia-nacional-escala-basica.php https://www.academiapinto.es/temario-de-ingreso-a-policia-nacional-escala-basica.php
Redirect 301 /curso-a-distancia-cabo-guardia-civil.php https://www.academiapinto.es/temario-de-ascenso-a-cabo-guardia-civil.php
Redirect 301 /curso-a-distancia-cabosub-guardia-civil.php https://www.academiapinto.es/temario-de-ascenso-a-cabo-guardia-civil.php
Redirect 301 /curso-a-distancia-suboficial-guardia-civil.php https://www.academiapinto.es/temario-de-ascenso-a-suboficial-guardia-civil.php
Redirect 301 /curso-a-distancia-oficial-guardia-civil.php https://www.academiapinto.es/temario-de-ascenso-a-oficial-guardia-civil.php
# antiguas de JUAN arregladas
# ahora cambiamos por las mejoras SEO las siguientes.
Redirect 301 /clases-presenciales-de-ingreso-guardia-civil.php https://www.academiapinto.es/curso-de-ingreso-a-guardia-civil.php
Redirect 301 /clases-online-de-ingreso-guardia-civil.php https://www.academiapinto.es/curso-online-de-ingreso-a-guardia-civil.php
Redirect 301 /clases-online-de-cabo-guardia-civil.php https://www.academiapinto.es/curso-online-de-ascenso-a-cabo-guardia-civil.php
Redirect 301 /curso-online-de-cabo-guardia-civil.php https://www.academiapinto.es/curso-online-de-ascenso-a-cabo-guardia-civil.php
# seguimos.
Redirect 301 /clases-online-de-oficial-guardia-civil.php https://www.academiapinto.es/curso-online-de-ascenso-a-oficial-guardia-civil.php
Redirect 301 /clases-online-de-suboficial-guardia-civil.php https://www.academiapinto.es/curso-online-de-ascenso-a-suboficial-guardia-civil.php
Redirect 301 /clases-presenciales-de-ascenso-a-oficial-guardia-civil.php https://www.academiapinto.es/curso-de-ascenso-a-oficial-guardia-civil.php
Redirect 301 /clases-presenciales-de-ascenso-a-suboficial-guardia-civil.php https://www.academiapinto.es/curso-de-ascenso-a-suboficial-guardia-civil.php
Redirect 301 /temario-Prueba-Conocimientos-Guardias-Jovenes-(Polillas).php https://www.academiapinto.es/temario-Guardias-Jovenes-(Polillas).php
#parche NO-CNP
Redirect 301 /curso-a-distancia-guardia-civil-y-policia-nacional.php https://www.academiapinto.es/curso-online-de-ingreso-a-guardia-civil.php
Redirect 301 /temario-Guardias-Jovenes-(Polillas).php https://www.academiapinto.es/temario-Guardias-Jovenes-(Polillas).php
# using root, not index.php ...
# RewriteRule ^index\.php$ https://www.academiapinto.es/ [L,R=301]
# RewriteRule ^index\.htm$ https://www.academiapinto.es/ [L,R=301]
# RewriteRule ^index\.html$ https://www.academiapinto.es/ [L,R=301]
RewriteRule ^/temario-de-ingreso-guardia-civil$ https://www.academiapinto.es/temario-de-ingreso-guardia-civil.php [L,R=301]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.*)$ $1.php
# ... seguridades varias que interesan ...
# If the requested path and file is not /index.php and the request
# has not already been internally rewritten to the index.php script
RewriteCond %{REQUEST_URI} !^/index\.php
# and the request is for something within the component folder,
# or for the site root, or for an extensionless URL, or the
# requested URL ends with one of the listed extensions
RewriteCond %{REQUEST_URI} /component/|(/[^.]*|\.(php|html?|feed|pdf|vcf|raw))$ [NC]
# and the requested path and file doesn´t directly match a physical file
RewriteCond %{REQUEST_FILENAME} !-f
# and the requested path and file doesn´t directly match a physical folder
RewriteCond %{REQUEST_FILENAME} !-d
# internally rewrite the request to the index.php script
RewriteRule .* index.php [L]
# ... check for parameters ...
# RewriteRule ^([A-Za-z0-9_]+)/([A-Za-z0-9_]+)/([A-Za-z0-9_]+)/([A-Za-z0-9_]+)$ /index.php [L]
# RewriteRule ^([A-Za-z0-9_]+)/([A-Za-z0-9_]+)/([A-Za-z0-9_]+)$ /index.php [L]
# RewriteRule ^([A-Za-z0-9_]+)/([A-Za-z0-9_]+)$ /index.php [L]
# RewriteRule ^([A-Za-z0-9_]+)$ /index.php [L]
# --- #RewriteRule ^(.*) /index.php?p1=ERROR_MODRW_ACCESS [L]
##############################################################
# Enable GZIP
<ifmodule mod_deflate.c>
AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
</ifmodule>
# Expires Headers - 2678400s = 31 days
<ifmodule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 1 seconds"
ExpiresByType text/html "access plus 7200 seconds"
ExpiresByType image/gif "access plus 2678400 seconds"
ExpiresByType image/jpeg "access plus 2678400 seconds"
ExpiresByType image/png "access plus 2678400 seconds"
ExpiresByType text/css "access plus 518400 seconds"
ExpiresByType text/javascript "access plus 2678400 seconds"
ExpiresByType application/x-javascript "access plus 2678400 seconds"
</ifmodule>
# Cache Headers
<ifmodule mod_headers.c>
# Cache specified files for 31 days 2678400
<filesmatch "\.(ico|flv|jpg|jpeg|png|gif|css|swf)$">
Header set Cache-Control "max-age=2678400, public"
</filesmatch>
# Cache HTML files for a couple hours 7200
<filesmatch "\.(html|htm)$">
Header set Cache-Control "max-age=7200, private, must-revalidate"
</filesmatch>
# Cache PDFs for a day 86400
<filesmatch "\.(pdf)$">
Header set Cache-Control "max-age=86400, public"
</filesmatch>
# Cache Javascripts for 31 days 2678400
<filesmatch "\.(js)$">
Header set Cache-Control "max-age=2678400, private"
</filesmatch>
</ifmodule>
##############################################################
Thanks, i'm really desperated with this one.
So I have one website, for example http://example.com/ and another one http://example.myeshop.com/. I want to make accessible URL http://example.com/eshop to be same as http://example.myeshop.com/, but no redirects. Also when someone use link like http://example.com/eshop/contact it would have same effect as http://example.myeshop.com/contact and so on. This is my .htaccess file:
IndexIgnore */*
RewriteEngine On
RewriteRule /eshop/(.*) http://example.myeshop.com/$1 [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/xhtml text/html text/plain text/xml text/javascript application/x-javascript text/css
</IfModule>
FileETag none
But doesn't seem to be working. Can you help me how to achieve such a thing?
What you are looking for is mod-proxy. Enable proxy module on your server and then you can use this :
RewriteEngine on
RewriteRule ^eshop/(.*)$ http://example.myeshop.com/$1 [P]
This will internally forword all requests of example.com to example.myeshop.com . You will get an internal server error if the proxy module isnt enabled.
If you have access to httpd.conf you can use below rules in your httpd.conf file where section for mod_proxy is mentioned or might be you have to put in extra/httpd-ajp.conf.
ProxyPass /eshop/ http://example.myeshop.com/
ProxyPassReverse /eshop/ http://example.myeshop.com/
These two lines should be uncommented in your httpd.conf file.
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_http_module modules/mod_proxy_http.so
I am having trouble ammending a site's htaccess file with some mod_rewrite directives I know work in isolation but not in context of the full htaccess file. The site's CMS is Concrete5, so there are some specifics for the Concrete5 configuration in the htaccess file.
I am trying to rewrite URLS of format
http://www.mywebsite.com/proplist/?location=town&distance=3&proptype=buy&maxPrice=&minPrice=&bedrooms=&propertyType=
to
http://www.mywebsite.com/property/town/buy/
I have got the following directives to work in isolation (where I created index.php in a folder called proplist under the webroot on another webserver):
RewriteBase /proplist
RewriteRule property/([a-zA-z]+)/([a-zA-z]+)/$ http://www.mywebsite.com/property/\/?location=$1&distance=3&proptype=$2&maxPrice=&minPrice=&bedrooms=&propertyType= [R]
Redirect 301 /property/ http://www.mywebsite.com/proplist/
(I guess I can use %{REQUEST_FILENAME} instead of http://www.mywebsite.com)
I can't get the above to work in the context of the htaccess file that is already in place which is (with my ammendments):
<IfModule mod_rewrite.c>
RewriteEngine On
#
# -- concrete5 urls start --
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME}/index.html !-f
RewriteCond %{REQUEST_FILENAME}/index.php !-f
RewriteRule . index.php [L]
</IfModule>
# -- concrete5 urls end --
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
# -- rewrite property search urls --
RewriteBase /proplist
RewriteCond %{REQUEST_URI} property
RewriteRule property/([a-zA-z]+)/([a-zA-z]+)/$ http://www.mywebsite.com/proplist/\/?location=$1&distance=3&proptype=$2&maxPrice=&minPrice=&bedrooms=&propertyType= [R]
Redirect 301 /property/ %{REQUEST_FILENAME}/proplist/
RewriteBase /
# -- end rewrite property search urls --
#Gzip
<ifmodule mod_deflate.c>
AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript text/javascript
</ifmodule>
#End Gzip
# remove browser bugs
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
Header append Vary User-Agent
## EXPIRES CACHING ##
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access plus 1 year"
ExpiresByType image/jpeg "access plus 1 year"
ExpiresByType image/gif "access plus 1 year"
ExpiresByType image/png "access plus 1 year"
ExpiresByType text/css "access plus 1 month"
ExpiresByType application/pdf "access plus 1 month"
ExpiresByType text/x-javascript "access plus 1 month"
ExpiresByType application/x-shockwave-flash "access plus 1 month"
ExpiresByType image/x-icon "access plus 1 year"
ExpiresDefault "access plus 1 week"
</IfModule>
## EXPIRES CACHING ##
AddType application/font-wof .woff
AddType application/x-font-woff .woff
AddType application/x-woff .woff
# end of full htaccess file
The result of the above is urls such as http://www.mywebsite.com/property/woking/buy/ being redirected to http://www.mywebsite.com/index.php
Can anyone help?
The first thing you need to do is place all the property search URL rules before the concrete5 routing rules. The routing rules completely mangle the URI and when a redirect happens, the mangled URI ends up getting redirected.
So that means these rules:
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
must be before your CMS rules.
You also probably want to change your rules from:
# -- rewrite property search urls --
RewriteBase /proplist
RewriteCond %{REQUEST_URI} property
RewriteRule property/([a-zA-z]+)/([a-zA-z]+)/$ http://www.mywebsite.com/proplist/\/?location=$1&distance=3&proptype=$2&maxPrice=&minPrice=&bedrooms=&propertyType= [R]
Redirect 301 /property/ %{REQUEST_FILENAME}/proplist/
RewriteBase /
# -- end rewrite property search urls --
to:
# -- rewrite property search urls --
RewriteRule ^property/([a-zA-z]+)/([a-zA-z]+)/$ /proplist/?location=$1&distance=3&proptype=$2&maxPrice=&minPrice=&bedrooms=&propertyType= [L]
RewriteRule ^property/$ /proplist/ [L]
# -- end rewrite property search urls --
But I'm not really sure what the point of your original rules were. They're a mix of mod_alias and mod_rewrite which was sure to be a mess. Change the flags from [L] to [L,R=301] if you actually wanted to redirect instead of rewriting (which is what you are asking for, rewriting is not redirecting). So those 2 rules need to go right below the one that redirects to www.
using typo3 4.5/extbase 1.3 i am trying to run my shop extension in a multidomain environment: the shop page should be run on a HTTP domain A and the following checkout process on a HTTPS domain B. Domain B is https://www.ssl-id.de/[domainA] (host is Strato). I therefore have set:
two page trees with both roots having an domain entry of domain A and domain B respectively
the checkout page in the HTTPS page tree have set "Use protocol" to HTTPS
the TS:baseURL is set conditionally to domain A or domain B (based on the ENV:HTTP_HOST)
the realurl configuration is set for both domains (with $TYPO3_CONF_VARS['EXTCONF']['realurl']['[domainA]'] and $TYPO3_CONF_VARS['EXTCONF']['realurl']['www.ssl-id.de'])
Unfortunately the redirect from the HTTP shop to the HTTPS checkout leads to Error 310 (net::ERR_TOO_MANY_REDIRECTS) in chrome. The network report says
Request URL:https://www.ssl-id.de/[domainA]/de/checkout.html?FE_SESSION_KEY=bc04cd0f5b835bcbdd8c475bafb037f7-ab3700f6a9fae520b75981130b31ec77&cHash=6d7e7195735947b09becbfa9c26c8bf0
Request Method:GET
Status Code:301 Moved Permanently
Request Headersview source
Accept:text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Charset:ISO-8859-1,utf-8;q=0.7,*;q=0.3
Accept-Encoding:gzip,deflate,sdch
Accept-Language:de-DE,de;q=0.8,en-US;q=0.6,en;q=0.4
Cache-Control:max-age=0
Connection:keep-alive
Cookie:fe_typo_user=bc04cd0f5b835bcbdd8c475bafb037f7
Host:www.ssl-id.de
User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.4 (KHTML, like Gecko) Chrome/22.0.1229.94 Safari/537.4
Query String Parametersview URL encoded
FE_SESSION_KEY:bc04cd0f5b835bcbdd8c475bafb037f7-ab3700f6a9fae520b75981130b31ec77
cHash:6d7e7195735947b09becbfa9c26c8bf0
Response Headersview source
Connection:Keep-Alive
Content-Length:0
Content-Type:text/html; charset=utf-8
Date:Wed, 07 Nov 2012 09:54:06 GMT
Keep-Alive:timeout=3, max=99
Location:https://www.ssl-id.de/[domainA]/de/checkout.html?FE_SESSION_KEY=bc04cd0f5b835bcbdd8c475bafb037f7-ab3700f6a9fae520b75981130b31ec77&cHash=6d7e7195735947b09becbfa9c26c8bf0
Server:Apache/2.2.21 (Unix) mod_ssl/2.2.21 OpenSSL/0.9.8r
Set-Cookie:fe_typo_user=bc04cd0f5b835bcbdd8c475bafb037f7; path=/[domainA]/
X-Powered-By:PHP/5.3.8
which reads as "The target page url does not exist, please look at the same url again". When using a second HTTP url instead of the HTTPS url, the setup works well. When calling the checkout page directly without redirect from the shop page, the result is the same error 310.
The .htaccess is a quite standard typo3-realurl .htaccess:
AddDefaultCharset utf-8
AddType video/mp4 mp4
AddType video/mp4 m4v
AddType video/ogg ogv
AddType video/webm webm
AddType video/webm webmv
<FilesMatch "\.(js|css)$">
<IfModule mod_expires.c>
ExpiresActive on
ExpiresDefault "access plus 7 days"
</IfModule>
FileETag MTime Size
</FilesMatch>
<IfModule mod_rewrite.c>
RewriteEngine On
#RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)\.(\d+)\.(php|js|css|png|jpg|gif|gzip)$ $1.$3 [L]
RewriteRule ^(typo3/|t3lib/|fileadmin/|typo3conf/|typo3temp/|uploads/|favicon\.ico) - [L]
RewriteRule ^typo3$ typo3/index_re.php [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule .* index.php [L]
</IfModule>
Any suggestions on how to remove the redirect problem or how to get closer to the caller of the redirect that leads to the infinite loop?
The problem has been host (Strato) specific: Their SSL Proxy does not send the relevant $_SERVER['HTTPS'] which somehow makes typo3 go crazy.
The solution is setting $_SERVER['HTTPS'] yourself by adding the following lines to the end of your localconf.php:
if ($_SERVER['HTTP_X_FORWARDED_HOST'] == "www.ssl-id.de") {
$_SERVER['HTTPS'] = 1;
}
or more general
if (this_is_a_ssl_request()) {
$_SERVER['HTTPS'] = 1;
}