2

You can create a symlink ln -s /var/www/html/files /var/www/html/public/files You will need Options +FollowSymLinks for this to work. Please note that this option adds a security risk as it allows accessing files outside of DocumentRoot. Alternatively you can add Alias /files /var/www/html/files to your VirtualHost configuration for this site. It is a more ...


2

The reason is the following block in nginx configuration: location ~.*\.(3gp|gif|jpg|jpeg|png|ico|wmv|avi|asf|asx|mpg|mpeg|mp4|pls|mp3|mid|wav|swf|flv|html|htm|txt|js|css|exe|zip|tar|rar|gz|tgz|bz2|uha|7z|doc|docx|xls|xlsx|pdf|iso|woff|ttf|svg|eot|sh|webp)$ { root /home/s4h/dl.domain123.org; expires max; try_files $uri $uri/ @backend; } This ...


2

Adding a redirect like this defeats the purpose of CDN in many ways. When clients request an image file, they first send request to your server, which responds with redirect, and then clients request it from CDN. This adds considerable latency to image loading. You should change CMS so that in preview it uses URLs from your server, but for front-end it uses ...


1

The term "rewrite" refers to a process which has as its input the URL requested by your website visitor, and as its output the URL passed to your CMS to produce the requested page. The service at https://www.generateit.net/mod-rewrite/ generates a rewrite rule allowing your pages to be reached through URLs of the form https://mywebsite.com/12/my-...


1

I'm assuming the static version of your site (at static.example.com) is literally a static non-WordPress site so cannot itself account for any redirects. There's nothing actually "wrong" with your rule as posted. However, ... The previous "WordPress" 301 (permanent) redirect from non-www to www will have been cached (persistently) by the ...


1

If you only want the front-controller to apply when accessed via bar.com then you could check the requested Host header in the rule. For example: RewriteCond %{HTTP_HOST} (^|\.)bar\.com [NC] RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ index.php [L] Or, exclude the /uploads subdirectory: RewriteCond %{...


1

There are a couple of ways to do this in apache, but none are great. The best way is to do this in wordpress instead, either building a tiny wordpress plugin to change all wp-login.php (the login page location) to your custom /login using the relevant hook: https://developer.wordpress.org/reference/hooks/login_url/ The only ways an apache rewrite could know ...


1

You have a chicken-and-egg problem. You don't know if a user is an administrator until he is logged in, so you don't have the information to make conditional redirect before login.


1

In addition to @AlexD's answer... think this must be possible using mod_rewrite in the .htaccess file This IS possible using mod_rewrite, but not in .htaccess. You would need to do this directly in the main server config (or VirtualHost container). In a directory (or .htaccess) context you are restricted to rewriting to a URL-path only. However, in a ...


Only top voted, non community-wiki answers of a minimum length are eligible