: Redirect requests fro fonts and icons to the main domain from a subdomain based on part of the URL path I am having trouble loading fonts and icons hosted on main domain from subdomain. Example:
I am having trouble loading fonts and icons hosted on main domain from subdomain.
Example:
I am on
sub.domain.loc/some/weird/path/desired/url/resource/to/load.extension
and I need to detect that /desired/url/ is in request and based on that redirect to:
domain.loc/url/desired/resource/to/load.extension
So far I failed getting 404 in the subrequest asking for that resource.
When I manually enter the desired url in address bar or edit request it succeeds and returns the resource. Given these circumstances I assume the problem is in redirection, so I googled a lot and found solution that is supposed to work, but it doesn't.
I am running Apache 2.4.18 with php7 on Xubuntu 16.04, my vhosts look like this:
<VirtualHost *:80>
DocumentRoot "/var/www/html/domain/"
ServerName domain.loc
</VirtualHost>
<VirtualHost *:80>
DocumentRoot /var/www/html/domain/sub/www/
ServerName sub.domain.loc
RewriteEngine on
RewriteRule ^(.*)desired/url/(.*) domain.loc/url/desired/ [R=301,L]
</VirtualHost>
What am I doing wrong?
Also what other stuff should I provide for the others to be able to determine the source of problem?
More posts by @Fox8124981
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.