Learn about Centmin Mod LEMP Stack today
Register Now

htaccess

Discussion in 'Install & Upgrades or Pre-Install Questions' started by Artonn, Feb 13, 2024.

  1. Artonn

    Artonn New Member

    21
    1
    3
    Nov 20, 2023
    Ratings:
    +1
    Local Time:
    9:47 PM
    How would I handle my htaccess on nginx, now that i am trying to move away from apache?


    Code:
    RewriteEngine On
    RewriteRule ^forum-aquascapes-akvarium-v%C3%A6rker$ https://danskeakvarier.dk/forums/aquascapes-akvarium-v%C3%A6rker.7/ [R=301,L]
    
    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]
    
    RewriteRule ^forum\-ny\-til\-ferskvands\-akvarie$ https://danskeakvarier.dk/forums/ny-til-ferskvands-akvarie.2/? [R=301,L]
    RewriteRule ^forum\-aquascapes\-akvarium\-v�rker$ https://danskeakvarier.dk/forums/aquascapes-akvarium-v�rker.7/? [R=301,L]
    RewriteRule ^forum\-markedsplads$ https://danskeakvarier.dk/categories/markedsplads.6/? [R=301,L]
    
    RewriteOptions inherit
    #    Mod_security can interfere with uploading of content such as attachments. If you
    #    cannot attach files, remove the "#" from the lines below.
    #<IfModule mod_security.c>
    #    SecFilterEngine Off
    #    SecFilterScanPOST Off
    #</IfModule>
    
    ErrorDocument 401 default
    ErrorDocument 403 default
    ErrorDocument 404 default
    ErrorDocument 405 default
    ErrorDocument 406 default
    ErrorDocument 500 default
    ErrorDocument 501 default
    ErrorDocument 503 default
    
    <IfModule mod_rewrite.c>
        RewriteEngine On
    
        #    If you are having problems with the rewrite rules, remove the "#" from the
        #    line that begins "RewriteBase" below. You will also have to change the path
        #    of the rewrite to reflect the path to your XenForo installation.
        #RewriteBase /xenforo
    
        #    This line may be needed to workaround HTTP Basic auth issues when using PHP as a CGI.
        #RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
    
        RewriteCond %{REQUEST_FILENAME} -f [OR]
        RewriteCond %{REQUEST_FILENAME} -l [OR]
        RewriteCond %{REQUEST_FILENAME} -d
        RewriteRule ^.*$ - [NC,L]
        RewriteRule ^(data/|js/|styles/|install/|favicon\.ico|crossdomain\.xml|robots\.txt) - [NC,L]
        RewriteRule ^.*$ index.php [NC,L]
    </IfModule>
    
     
  2. brijendrasial

    brijendrasial Active Member

    202
    147
    43
    Mar 21, 2018
    Ratings:
    +229
    Local Time:
    1:17 AM
    1.13.9
    10.0.22-MariaDB