LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 03-03-2011, 05:01 AM   #1
taara
LQ Newbie
 
Registered: Mar 2009
Posts: 23
Blog Entries: 1

Rep: Reputation: 2
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]

Last edited by taara; 03-03-2011 at 05:01 AM. Reason: nginx, apache, rewrite, conversion
 
Old 03-13-2011, 01:51 PM   #2
timetraveler
Member
 
Registered: Apr 2010
Posts: 243
Blog Entries: 2

Rep: Reputation: 31
Show the ones that you completed and are working.
 
Old 03-14-2011, 11:07 AM   #3
taara
LQ Newbie
 
Registered: Mar 2009
Posts: 23
Blog Entries: 1

Original Poster
Rep: Reputation: 2
NVM ... I will post them all once I have completed them. cheers
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache trailing slash problem for multiple rewrites deesto Linux - Server 6 01-16-2011 02:01 AM
more fun with Apache rewrites proxies and trailing slashes deesto Linux - Server 1 03-29-2010 12:05 PM
Using MySQL to manage rewrites for Apache bahbahthelamb Linux - Server 2 03-08-2010 01:19 PM
Apache rewrites screwing up images deesto Linux - Server 7 01-22-2010 04:58 PM
Nginx like as a reverse proxy for Apache Abadon_ Linux - Server 0 11-13-2009 05:53 AM


All times are GMT -5. The time now is 04:12 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration