LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Apache rewrites to nginx (https://www.linuxquestions.org/questions/linux-newbie-8/apache-rewrites-to-nginx-866184/)

taara 03-03-2011 05:01 AM

Apache rewrites to nginx
 
Hi

I need to convert apache 2.2 rewrites to nginx/0.7.67, with simple rewrites I would manage, but the ones I need to convert are a bit too much for me. If there is a kind soul out there that is willing to look into it please do. I am sure others will benefit from this conversion.

Code:

    RewriteCond %{HTTP_HOST} ^(.+)\.domain.domain.com [NC]
    RewriteCond /var/opt/dir/www/dir_%1 !-d
    RewriteRule (.*) http://domain.domain.com/nosuch404 [L]

    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^(.+)\.domain.domain.com [NC]
    RewriteCond %{HTTP_HOST) !^www\.
    RewriteRule (.*) /shop_%1$1 [L]

    RewriteCond %{HTTP_HOST} !domain\.domain\.com$
    RewriteRule .* http://www.domain.com/nosuchurl [L]

    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
    RewriteCond %{REQUEST_URI} !^/(media|skin|js)/
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-l
    RewriteRule ^/var/opt/domain/www/dir_([^/]*)/.* /index.php [L]

    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
    RewriteCond %{REQUEST_URI} !^/(media|skin|js)/
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-l
    RewriteRule ^/var/opt/domain/www/dir_([^/]*)/.* /dir_$1 index.php [L]


timetraveler 03-13-2011 01:51 PM

Show the ones that you completed and are working.

taara 03-14-2011 11:07 AM

NVM ... I will post them all once I have completed them. :) cheers


All times are GMT -5. The time now is 02:22 AM.