New answers tagged

2

Because, since the redirect is unconditional, you end up redirecting again after the URL has been rewritten to index.php (the WordPress front-controller). When you request /somepage.php: You are redirected to /somepage (by the first rule). The redirect response is sent back to the client. On the second request, /somepage is internally rewritten to /index....


0

Instead of writing this out again, I'm going to quote and link to my previous answer: As of 2021, some of the "improvements" that Litespeed has developed vs. Apache are more theoretical than practical, such as HTTP/3 support (UDP-only) which is not even widely supported: https://stackoverflow.com/questions/60701073/any-benchmarks-showing-litespeed-...


0

You should look into Virtual hosts. https://httpd.apache.org/docs/2.4/vhosts/


1

Since siteA.com and siteB.com point to different vHosts/servers then you can remove all the existing directives in siteB.com/.htaccess and use the simpler mod_alias Redirect and RedirectMatch directives. For example: # siteB.com/.htaccess # Specific redirects Redirect 301 /foo https://siteA.com/another-foo Redirect 301 /bar https://siteA.com/another-bar ...


1

Your nginx is trying to connect to localhost inside the container. You have to either use host networking for the container or you need to link the nginx container to the WordPress container. In the docker-compose file that would be: external_links: - wordpress:wordpress Then you can use proxy_pass http://wordpress/ in your nginx config. You don't need ...


0

You can use referrers (http://nginx.org/en/docs/http/ngx_http_referer_module.html#valid_referers) valid_referers none blocked server_names docs.google.com; Than you can just use $invalid_referer variable in your location block. if ($invalid_referer) { rewrite /wp-content/uploads/(.*)$ /dl-file.php?file=$1; }


0

This is not an answer, but it is too long to be a comment, so I'm writing this as an answer. What you are trying to achieve is possible. However to implement it, you'd need a more complex software stack. You'd need some key-value storage (e.g. Redis), and a web server able to use it while serving a request (e.g. nginx with lua-nginx-module and lua-resty-...


Top 50 recent answers are included