Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
SEO/rewrite rules nginx
ashabele
New
Hello,
My goal is to have the 'nice' urls (ie http://www.thesitsgirls.com/forum/categories/start-here instead of http://www.thesitsgirls.com/forum/index.php?p=/categories/start-here). The hosting company (synthesis) uses an nginx configuration. They told me to send them the .htaccess I would use and they would translate it. However, when that is done, and I try to adjust the settings, I still get a 500 error.
This is what we had sent them to translate. Is there something I'm missing?
RewriteEngine On
RewriteBase /forum/
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [QSA,L]
RewriteRule ^$ index.php/$1
Thank you so much in advance for any help. I'm at a loss here..
0
Comments
All you'll need is this:
Also see: http://blog.bigdinosaur.org/vanilla-forum-on-nginx/
I also use Nginx and that does work.
This is what I think it should look like for apache, it has to do with relative path to the root. But it's hard to explain it all here , check this out it may help you get a handle on it.
http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html#rewriterule
Also here is an online converter you paste the apache htaccess and it converts it to nginx. Maybe you can do it yourself ad see what went wrong.
http://www.anilcetin.com/convert-apache-htaccess-to-nginx/
❌ ✊ ♥. ¸. ••. ¸♥¸. ••. ¸♥ ✊ ❌
this is good convertor I converted the part at the top you put and the nginx result was this
that look like the root / is the default
http://winginx.com/htaccess
❌ ✊ ♥. ¸. ••. ¸♥¸. ••. ¸♥ ✊ ❌
It is much better to understand than rely on converters, you could end up doing something you don't really want to do. No substitute for learning.
That blog link is useful, though there is much personal to the setup, how it is done. There is also sort of nuances you ca put into your setup.
The main thing with nginx is to understand why
if
is limited and doesn't work as expected, so not to use it too much.grep is your friend.
Okay so according to the host, there's something else in the forum configuration that's not right and I have been attempting to find it without any clue where I should be looking.
WordPress is installed on the main site.
Vanilla in directory (/forum)
When vanilla is installed on this host (the nginx) in the root directory, and I turn on the nice urls, it works fine.
When it's installed in a directory (/forum) and I turn them on, I get the error.
The server implemented the redirect rules, but it's still not working and I'm getting this from the server:
Any ideas? I am desperate to make this work once and for all...
You need to make sure the rewrite rules file is in the /forum direcrtory.
Since it's on an nginx that file will never be read (according to the server..)
Anyone? Or does anyone have a recommendation on someone I can hire to fix this?
You need to have the host put the rewrite rules in the /forum directory.
Again it is about understanding what you actually applied.
Did set up
/forum
instead of root/
you change@forum
to the valid rewrite? You can't just copy an paste rule an expect it to work for different things. It is actually fairly logical you point it to where it need to go, you rewrite it to where it is. This is documented. it is not so for removed from Apache rules.Also did you reload the nginx configuration?
grep is your friend.
I am still not having any luck, and I just don't know why. This is what I have:
What am I missing??
I'm sorry but if that was you hosts attempt it just goes to show that few hosts are competent nginx specialists.
put the php handler before this e.g.
grep is your friend.