Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Server Operation

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 24th November 2012, 10:33
nerijussk nerijussk is offline
Junior Member
 
Join Date: Nov 2012
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Apche rewrite rule convert to nginx

Hello,
please help me converte apache rewrite rule to nginx:

RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^naujienos+ news.php/$1 [L]
RewriteRule ^naujienos/p(.*)$ /news.php?pg=$1 [nc]
RewriteRule ^naujienos/?$ /news.php [nc]
RewriteRule ^naujienos?$ /news.php [nc]
Reply With Quote
Sponsored Links
  #2  
Old 25th November 2012, 15:31
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,751 Times in 2,581 Posts
Default

Have you tried these two .htaccess converters?

http://winginx.com/htaccess
http://www.anilcetin.com/convert-apa...cess-to-nginx/
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #3  
Old 25th November 2012, 15:43
nerijussk nerijussk is offline
Junior Member
 
Join Date: Nov 2012
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

yes but does not work
Reply With Quote
  #4  
Old 26th November 2012, 19:15
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,751 Times in 2,581 Posts
 
Default

Try

Code:
if (!-e $request_filename){ 
  rewrite ^/naujienos+ /news.php/$1 break; 
}
rewrite ^/naujienos/p(.*)$ /news.php?pg=$1; 
rewrite ^/naujienos/?$ /news.php; 
rewrite ^/naujienos?$ /news.php;
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
nginx rewrite for drupal icphedia Installation/Configuration 6 24th November 2013 11:50
Installing Nginx With PHP5 (And PHP-FPM) And MySQL Support On CentOS 6.3 Totenkopf HOWTO-Related Questions 1 5th November 2012 13:26
nginx rewrite onastvar General 1 31st July 2012 19:25
Set Up Ubuntu-Server 6.10 As A Firewall/Gateway knowram Installation/Configuration 10 13th June 2007 02:37
need some help with a .htaccess rewrite rule.. edge Server Operation 7 22nd July 2006 17:54


All times are GMT +2. The time now is 12:29.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.