Question on index.php
-
Hi!
This is probably a very dumb question. I’ve done a bit of searching around the forums and Google for an answer to this. Didn’t come up with anything.
I have wordpress up and running on an Nginx web server. Everything works — permalinks, etc etc. In my Nginx configuration file, I have a snippet such as this which is the equivalent to Apache’s mod_rewrite rules:
—–8<———
if (!-e $request_filename) {
rewrite ^(.+)$ /index.php?q=$1 last;
}
—–8<———My question is, how does this work? More specifically, I know that with the rule in place, a URL like https://myblog/path/to/post gets rewritten internally and I am shown the correct post. So shouldn’t that mean without such a rewriting rule, if I use a URL like https://myblog/index.php?q=path/to/my/post I should get the correct post?
But I don’t. It doesn’t seem to work. Any ideas why? Is the index.php?q=whatever bit not meant to be called directly? I just wanted to confirm that bit first before I look into the Nginx side and figure if that’s where I should probe more …
Thanks and Regards,
Rakhesh
- The topic ‘Question on index.php’ is closed to new replies.