XF 2.2 MyBB redirections to Xenforo

Non funziona perché devi rimuovere /new/

danskeakvarier.dk/threads/akvariehobbien-hvor-skal-jeg-starte.13/
danskeakvarier.dk/new/threads/akvariehobbien-hvor-skal-jeg-starte.13/
 
Last edited:
You're doing it the wrong way if you ended up using "Redirect .....". While it may work, it can lead to unexpected results if you add more to .htaccess in the future or if you move to another host in the future that loads Apache modules in a different order.

When doing redirects, you should not mix mod_alias redirects with mod_rewrite redirects. The reason is, although you read the .htaccess files top to bottom, that's not how Apache processes it. First, one module scans for its directives top to bottom, then the other module scans top to bottom. And which scans first depends on how Apache is configured.

Since Xenforo is using mod_rewrite, I recommend always using mod_rewrite directives as well (unless there is a specific reason not to). Here are examples with and without "new":

Code:
RewriteRule ^/?thread-akvariehobbien-hvor-skal-jeg-starte https://danskeakvarier.dk/new/threads/akvariehobbien-hvor-skal-jeg-starte.13/ [R=301,NC,L]

RewriteRule ^/?thread-akvariehobbien-hvor-skal-jeg-starte https://danskeakvarier.dk/threads/akvariehobbien-hvor-skal-jeg-starte.13/ [R=301,NC,L]
 
You're doing it the wrong way if you ended up using "Redirect .....". While it may work, it can lead to unexpected results if you add more to .htaccess in the future or if you move to another host in the future that loads Apache modules in a different order.

When doing redirects, you should not mix mod_alias redirects with mod_rewrite redirects. The reason is, although you read the .htaccess files top to bottom, that's not how Apache processes it. First, one module scans for its directives top to bottom, then the other module scans top to bottom. And which scans first depends on how Apache is configured.

Since Xenforo is using mod_rewrite, I recommend always using mod_rewrite directives as well (unless there is a specific reason not to). Here are examples with and without "new":

Code:
RewriteRule ^/?thread-akvariehobbien-hvor-skal-jeg-starte https://danskeakvarier.dk/new/threads/akvariehobbien-hvor-skal-jeg-starte.13/ [R=301,NC,L]

RewriteRule ^/?thread-akvariehobbien-hvor-skal-jeg-starte https://danskeakvarier.dk/threads/akvariehobbien-hvor-skal-jeg-starte.13/ [R=301,NC,L]

Thank you, i've corrected my rewrites

Code:
RewriteCond %{HTTP_HOST} ^danskeakvarier\.dk$ [OR]
RewriteCond %{HTTP_HOST} ^www\.danskeakvarier\.dk$
RewriteRule ^thread\-akvariehobbien\-hvor\-skal\-jeg\-starte$ "https\:\/\/danskeakvarier\.dk\/threads\/akvariehobbien\-hvor\-skal\-jeg\-starte\.13\/" [R=301,L]
RewriteRule ^thread\-den-fiskeløse\-cyklus\-etablering\-af\-nyt\-akvarie$ "https://danskeakvarier.dk/threads/den-fiskeløse-cyklus-etablering-af-nyt-akvarie.7/" [R=301,L]
RewriteRule ^thread\-akvarie\-vandet\-bliver\-hvidt$ "https://danskeakvarier.dk/threads/akvarie-vandet-bliver-hvidt.9/" [R=301,L]
RewriteRule ^thread\-hvad\-er\-kvælstofkredsløbet\-de\-tre\-stadier\-i\-dit\-akvarie$ "https://danskeakvarier.dk/threads/hvad-er-kvælstofkredsløbet-de-tre-stadier-i-dit-akvarie.6/" [R=301,L]
RewriteRule ^thread\-human\-metode\-til\-aflivning\-af\-syge\-fisk$ "https://danskeakvarier.dk/threads/human-metode-til-aflivning-af-syge-fisk.15/" [R=301,L]
RewriteRule ^thread\-hvornår\-er\-ammoniak\-ammonium\-giftigt$ "https://danskeakvarier.dk/threads/hvornår-er-ammoniak-ammonium-giftigt.14/" [R=301,L]
 
Try this:

Code:
RewriteCond %{HTTP_HOST} ^danskeakvarier\.dk$ [OR]
RewriteCond %{HTTP_HOST} ^www\.danskeakvarier\.dk$
RewriteRule ^thread\-akvariehobbien\-hvor\-skal\-jeg\-starte$ https://danskeakvarier.dk/threads/akvariehobbien-hvor-skal-jeg-starte.13/ [R=301,L]
RewriteRule ^thread\-den-fiskeløse\-cyklus\-etablering\-af\-nyt\-akvarie$ https://danskeakvarier.dk/threads/den-fiskeløse-cyklus-etablering-af-nyt-akvarie.7/ [R=301,L]
RewriteRule ^thread\-akvarie\-vandet\-bliver\-hvidt$ https://danskeakvarier.dk/threads/akvarie-vandet-bliver-hvidt.9/ [R=301,L]
RewriteRule ^thread\-hvad\-er\-kvælstofkredsløbet\-de\-tre\-stadier\-i\-dit\-akvarie$ https://danskeakvarier.dk/threads/hvad-er-kvælstofkredsløbet-de-tre-stadier-i-dit-akvarie.6/ [R=301,L]
RewriteRule ^thread\-human\-metode\-til\-aflivning\-af\-syge\-fisk$ https://danskeakvarier.dk/threads/human-metode-til-aflivning-af-syge-fisk.15/ [R=301,L]
RewriteRule ^thread\-hvornår\-er\-ammoniak\-ammonium\-giftigt$ https://danskeakvarier.dk/threads/hvornår-er-ammoniak-ammonium-giftigt.14/ [R=301,L]

I am not sure what you are trying to do with:
RewriteCond %{HTTP_HOST} ^danskeakvarier\.dk$ [OR]
RewriteCond %{HTTP_HOST} ^www\.danskeakvarier\.dk$

These will only apply to the first RewriteRule below them. From when I can see, they shouldn't be needed at all unless you have non danskeakvarier.dk domain names being serviced by the .htaccess file.
 
Try this:

Code:
RewriteCond %{HTTP_HOST} ^danskeakvarier\.dk$ [OR]
RewriteCond %{HTTP_HOST} ^www\.danskeakvarier\.dk$
RewriteRule ^thread\-akvariehobbien\-hvor\-skal\-jeg\-starte$ https://danskeakvarier.dk/threads/akvariehobbien-hvor-skal-jeg-starte.13/ [R=301,L]
RewriteRule ^thread\-den-fiskeløse\-cyklus\-etablering\-af\-nyt\-akvarie$ https://danskeakvarier.dk/threads/den-fiskeløse-cyklus-etablering-af-nyt-akvarie.7/ [R=301,L]
RewriteRule ^thread\-akvarie\-vandet\-bliver\-hvidt$ https://danskeakvarier.dk/threads/akvarie-vandet-bliver-hvidt.9/ [R=301,L]
RewriteRule ^thread\-hvad\-er\-kvælstofkredsløbet\-de\-tre\-stadier\-i\-dit\-akvarie$ https://danskeakvarier.dk/threads/hvad-er-kvælstofkredsløbet-de-tre-stadier-i-dit-akvarie.6/ [R=301,L]
RewriteRule ^thread\-human\-metode\-til\-aflivning\-af\-syge\-fisk$ https://danskeakvarier.dk/threads/human-metode-til-aflivning-af-syge-fisk.15/ [R=301,L]
RewriteRule ^thread\-hvornår\-er\-ammoniak\-ammonium\-giftigt$ https://danskeakvarier.dk/threads/hvornår-er-ammoniak-ammonium-giftigt.14/ [R=301,L]

I am not sure what you are trying to do with:
RewriteCond %{HTTP_HOST} ^danskeakvarier\.dk$ [OR]
RewriteCond %{HTTP_HOST} ^www\.danskeakvarier\.dk$

These will only apply to the first RewriteRule below them. From when I can see, they shouldn't be needed at all unless you have non danskeakvarier.dk domain names being serviced by the .htaccess file.

What was changed here? :D
 
Top Bottom