2

I installed a script and it had htaccess for apache but I use nginx so I used the online htaccess to nginx conversion tool and converted my htaccess

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /
RewriteRule ^uploads - [L,NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/?$ index.php?rp=$1 [L]
</IfModule>
<ifModule mod_headers.c>
Header set Access-Control-Allow-Origin: *
</ifModule>

to

#ignored: "-" thing used or unknown variable in regex/rew 
if (!-f $request_filename){
set $rule_1 1$rule_1;
}
if (!-d $request_filename){
set $rule_1 2$rule_1;
}
if ($rule_1 = "21"){
rewrite ^/(.*)/?$ /index.php?rp=$1 last;
}

After that the rewrite rules are working for site and I can almost use and browse the site but there is only a small problem, the jquery/ajax links in my admin panel are not working.

They are mostly "Collapse" type tabs.

Example: moderator/?sk=videos#collapse0

Any idea what could be wrong ? I am on centos 6, nginx with php-fastcgi

1 Answer 1

1

I don't know what the uploads rewrite do, but the second one is

location / {
  try_files $uri $uri/ /index.php?rp=$request_uri;
}
Sign up to request clarification or add additional context in comments.

2 Comments

oh god, really need to start using try_files rather then if Wish someone creates a better htaccess converter for nginx
If you run into any problem that your ajax isn't loading a URL from a remote site, add this to your config, it's written in the htaccess but I prefer not to add it unless you need it. add_header Access-Control-Allow-Origin *;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.