I
I
Igor Gorgul2015-09-23 14:14:07
Apache HTTP Server
Igor Gorgul, 2015-09-23 14:14:07

Why don't .htaccess rules work?

The server works in conjunction with apache + nginx. If you write some simple rule, then it works, for example: "RewriteRule ^ www.google.com " and put it in site.ltd/affiliates/
Then when you open site.ltd/affiliates/ it redirects correctly, but if you open any folder inside the site.ltd/affiliates/ folder, for example site.ltd/affiliates/scripts/jobs.php - the redirect doesn't work, so the rules don't seem to work where they should.
Specifically, the request:
site.ltd/affiliates/accounts/default1/banners/NotE...
should be redirected to:
site.ltd/affiliates/scripts/file.php?file=banners/...
but that doesn't work . If I open the first link, I will see a 404 error, and the second link leads to a small 1*1 pixel image.

# Start Post Affiliate Pro Code
Options -Indexes

<ifModule mod_rewrite.c>

RewriteEngine on
#replicated sites
RewriteRule ^sites/([^/]+)/([^/]+)/(.*) scripts/page.php?a_aid=$2&a_bid=$1&a_file=$3 [L,QSA]
RewriteRule ^sites/([^/]+)/*(.*) scripts/page.php?a_aid=$2&a_bid=$1&a_redir=Y [L,QSA]
RewriteRule ^accounts/default1/files/(.*) scripts/file.php?file=files/$1 [L,QSA]
RewriteRule ^accounts/default1/banners/(.*) scripts/file.php?file=banners/$1 [L,QSA]

#accessing non-tpl theme files
RewriteRule ^accounts/default1/themes/(.*) scripts/file.php?file=themes/$1 [L,QSA]

</ifModule>

# End of Post Affiliate Site Pro Code

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Igor Gorgul, 2015-09-23
@xXxSPYxXx

The problem turned out to be nginx, as it took all the static and did not give it to apache. I solved the problem by editing the nginx config.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question