Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Tue Dec 13, 2011 1:16 am 
Offline
Senior Newbie

Joined: Wed Nov 23, 2011 11:01 am
Posts: 16
ICQ: 35213257
Website: http://freshma.de/
Location: Saint Louis, MO
I did a simple rewrite on a site I'm working on to essentially drop the .php from files, it's a little more verbose than I'd like but seems to work.

Code:
rewrite ^/(.*)$ http://site.com/$1 permanent;
rewrite ^/(.*)$ /$1.php;


This works fantastic but some of my scripting (mainly in oath) would prefer to allow the .php to pass through still, and now my images don't work no matter how they're linked.

Eventually I'll be needing to figure out how to write the rules to work for the wildcard DNS subdomain I stuff I have set up (as in user.site.com would be site.com/?uservar=user).

I'm fairly new to Nginx, luckily someone way smarter than myself in the arts of Nginx wrote a Wordpress port so my blog is working fantastic. Any help in this matter would be greatly appreciated. I tried my old working Apache rules in http://www.anilcetin.com/convert-apache-htaccess-to-nginx/ but they don't function in this sites config file.

_________________
Newbie to Linode, excited to be here!


Top
   
 Post subject:
PostPosted: Tue Dec 13, 2011 1:52 am 
Offline
Senior Newbie

Joined: Wed Nov 23, 2011 11:01 am
Posts: 16
ICQ: 35213257
Website: http://freshma.de/
Location: Saint Louis, MO
I fixed it I with a little recon work via a few Nginx sites, seems that my initial logic was indeed flawed, below seems to work.

Code:
if (!-e $request_filename) {
rewrite ^/(.*)$ /$1.php;
}


Now hopefully when the time comes I can get the user.site.com rule working.

_________________
Newbie to Linode, excited to be here!


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group