Hello, I would like to set a redirection from support.dom.tld to www.dom.tld/toto/tata/tutu/index.php I did it simply : I create a website called support.dom.tld. I choose redirect 301,L and proxy But... When opening browser calling support.dom.tld, at the very end, I have www.dom.tld/toto/tata/tutu/index.php in address bar. I would like support.dom.tld when opening the page as my browser should call www.dom.tld/toto/includes/jquery/css/base/jquery-ui.css, it becomes nothing good with support.dom.tld ! Is that possible to keep support.dom.tld ? Could I use apache snipset ? Many thanks
You can try setting the support.dom.tld redirect type to 'proxy' and set redirect path to http://www.dom.tld/toto/tata/tutu/ (or try https) .. that will add a RewriteRule to proxy that site; anything needed beyond that would require custom apache directives.
I did that but css and js in not uploaded. It is requesting both (css and js) at "https://suport.dom.tld/toto/tata..." I need a rewrite rule for js css and others ... Not sure I will succeed in. Let's try !
I try that, as apache snipset <IfModule mod_rewrite.c> SSLProxyEngine On RewriteCond %{HTTP_HOST} ^support\.dom\.fr(.*)$ [NC] RewriteRule ^/(.*)[toto](.*)$ https://www.dom.fr/$1 [proxy, L] RewriteRule ^/(.*)$ https://www.dom.fr/toto/tata/tutu/$1 [proxy, L] </IfModule> But I have a vhost error ! ld /etc/apache*/*/support.dom.fr.vhost* -rw-r--r-- 1 root root 6460 Oct 25 21:19 /etc/apache2/sites-available/support.dom.fr.vhost.err -rw-r--r-- 1 root root 6417 Oct 25 21:19 /etc/apache2/sites-available/support.dom.fr.vhost I don't know if I can combine proxy and L... How can I manage that ?
Try apache mod_proxy via custom apache directives, there are more options to do what you need. https://httpd.apache.org/docs/2.4/rewrite/flags.html#flag_p https://httpd.apache.org/docs/2.4/mod/mod_proxy.html
I DID it ! Code: SSLProxyEngine On ProxyPassMatch ^/toto/(.*)$ https://www.dom.fr/toto/$1 ProxyPass / https://www.dom.fr/toto/tata/tutu/ ProxyPassReverse / https://www.dom.fr/ Manyyy thanks