Home Forum
2017-11-22
Menu principale
Prodotti
Giochi a premi
Accedi ai servizi
Newsletter
Ricezione
Benvenuto, Ospite
Nome Utente Password: Ricordami

rewriting top level domain
(1 Online) (1) Ospite
  • Pagina:
  • 1

ARGOMENTO: rewriting top level domain

rewriting top level domain 6 Anni, 5 Mesi fa #2265

  • kraej
  • Offline
  • Fresh Boarder
  • Messaggi: 14
Hey there!

I am a bit struggling with one thing - I just don't get it ...

I have two Domains pointing at the same website - mydomain.de and mydomain.com. What I want to do is an automativ rewriting to change the .de to .com - but I need to keep the parameters. If possible I need to change the first subdirectory in the URL as well ..

Example:

mydomain.de/DE/ ---> mydomain.com/de/

plus parameters:
mydomain.de/DE/home?show=weltweit ---> mydomain.com/de/home?show=weltweit
...

Can this be done with ReDJ? And how?

Thanks so far!

Cheers,
kraej

Re: rewriting top level domain 6 Anni, 5 Mesi fa #2270

  • admin
  • Offline
  • Administrator
  • Messaggi: 1603
If on the first domain .de there's ReDJ then you can get it, because the destination is a full URL (so you can change the domain).

Try these (match any URL):

From URL: /
To URL: http://mydomain.com/de{pathltrim /DE}{queryfull}


Note that the second domain should be a different site/Joomla/ReDJ, to avoid loop.

Luigi

Re: rewriting top level domain 6 Anni, 5 Mesi fa #2275

  • kraej
  • Offline
  • Fresh Boarder
  • Messaggi: 14
Hi Luigi,

thanks for that idea, but the 2 domains are pointing at the same website. And unfortunalety I cannot just redirect the .de to .com via the domain administration for example as I would loose the querystring So I need a way to change the ".TLD/language/" via ReDJ or .htaccess.

Jochen

Re: rewriting top level domain 6 Anni, 5 Mesi fa #2289

  • kraej
  • Offline
  • Fresh Boarder
  • Messaggi: 14
Hmm.. any idea anyone?

Cheers

Re: rewriting top level domain 6 Anni, 5 Mesi fa #2291

  • admin
  • Offline
  • Administrator
  • Messaggi: 1603
With the current version of ReDJ this is not possible because ReDJ uses REQUEST_URI and ignore the domain. I think you could solve with .htaccess rewrite rule. Something like this:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.mydomain\.de$
RewriteRule ^/DE/(.*)$ http://www.mydomain.com/de/$1 [L,R]


Best regards,
Luigi
Ultima modifica: 6 Anni, 5 Mesi fa Da admin.

Re: rewriting top level domain 6 Anni, 5 Mesi fa #2296

  • kraej
  • Offline
  • Fresh Boarder
  • Messaggi: 14
Hi Luigi,

thanks for your help so far. I realised by myself that I need to play around with the htaccess what I did. But I do have a problem - maybe you have an idea.

I first tried:

RewriteCond %{HTTP_HOST} ^(www\.)komm-mit\.de$
RewriteRule ^(.*)$ www.komm-mit.com/$1 [R=301,L]


That rewrites www.mydomain.de/DE/path --> www.mydomain.com/index.php/path

I tried as you suggested:

RewriteCond %{HTTP_HOST} ^(www\.)komm-mit\.de$
RewriteRule ^/DE/(.*)$ www.komm-mit.com/de/$1 [R=301,L]


This just throws a 500 ... any help would be appreciated


___________________________________________
The first part of my rewrite rules is btw created by Joomla:

RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
#
# 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 root, or for an extensionless URL, or the
# requested URL ends with one of the listed extensions
RewriteCond %{REQUEST_URI} (/[^.]*|\.(php|html?|feed|pdf|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



Cheers!
Jochen

Re: rewriting top level domain 6 Anni, 5 Mesi fa #2297

  • admin
  • Offline
  • Administrator
  • Messaggi: 1603
Hi,
first put this rule just after RewriteEngine On (before the Joomla ones).

Then, check this:

RewriteCond %{HTTP_HOST} ^(www\.)komm-mit\.de$

Maybe it should be:

RewriteCond %{HTTP_HOST} ^www\.komm-mit\.de$

Let me know,
Luigi
  • Pagina:
  • 1
Moderatori: admin
Tempo generazione pagina: 0.48 secondi
News
Cerca con Google
Chi è online
 66 visitatori online
Sponsor

Slotmachineaamsonline.com è una guida alle migliori slot machine online legali in Italia. Sul sito trovi un elenco sempre aggiornato dei casino online con Slot machine e bonus slot, le ultime novità dal mondo delle slot online e le migliori strategie per vincere. Inoltre, è disponibile una sezione dedicata alle slot machine da BAR che finalmente sono disponibili nella versione online.