Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Fri Apr 18, 2014 1:52 pm 
Offline
Senior Member

Joined: Wed Dec 01, 2010 10:39 am
Posts: 71
Website: http://www.pannix.net
Location: Belgium
If you set up a wordpress blog on a LEMP, you have the following snippet in the configuration for the virtual host:
Code:
    location / {
        try_files $uri $uri/ /index.php?$args;
    }

I believe I understand how it works. When you surf to http://www.mywordpressblog.com/cat/this-is-a-post.
It first tries to find cat/this-is-a-post in the documentroot. If not found, it tries cat/this-is-a-post/
If this doesn't work it passes some arguments $args to the index.php file.

Question: How do I access the value(s) in $args from within the php code in index.php?
The thing is I want to get hold of the "/cat/this-is-a-post" string, which I can via $_SERVER["REQUEST_URI"], but I want to know what is in $args as well.

pannix


Top
   
PostPosted: Fri Apr 18, 2014 2:11 pm 
Offline
Senior Member

Joined: Fri Feb 17, 2012 8:20 pm
Posts: 365
I haven't tested it out but I supposed it would be in the $_GET array in PHP?


Top
   
PostPosted: Fri Apr 18, 2014 2:34 pm 
Offline
Senior Member

Joined: Wed Dec 01, 2010 10:39 am
Posts: 71
Website: http://www.pannix.net
Location: Belgium
No, the $_GET array is empty.
Trying to read some documentation on this but it gives me a headache, maybe the value of $args is supposed to end up in $_SERVER["REQUEST_URI"]?


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


Who is online

Users browsing this forum: No registered users and 3 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