Support

Admin Tools

#32774 htaccess

Posted in ‘Admin Tools for Joomla! 4 & 5’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Environment Information

Joomla! version
n/a
PHP version
n/a
Admin Tools version
n/a

Latest post by mitokat on Wednesday, 01 April 2020 10:09 CDT

mitokat
Hi,
I am trying to have a wildcard subdomain set up where if anyone types any subdomain on the site it redirects to the main home page. I was hoping to do it via the tools but I dont think its possible. I googled it and found a couple "suggestions" but its not working.

So I have two questions.. one is this a bad idea? and two how to do it.

I set up the dns to do a wildcard redirect to the main ip address but its not working as I wanted it to so I was trying to accomplish this via htaccess.

thanks

nicholas
Akeeba Staff
Manager
Admin Tools is irrelevant to what you're trying to do.

First, you'd need to set up your web server to respond to all possible subdomains. This is something that is done in the server configuration to which PHP (therefore Joomla and Admin Tools) have no access to.

Once you do that, all possible subdomains would respond with the same content. You would have to write custom .htaccess code to redirect the non-canonical subdomains to your canonical subdomain. This is not something Admin Tools will do for you and it's well outside the scope of our support. In fact, it's something you shouldn't be doing in the .htaccess. Since you're already modifying the server configuration to allow all subdomains to be responded to by the same document root you should write your redirection rule in there, not the .htaccess file. This has very significant performance benefits (the server configuration is read and parsed once, when the web server starts, whereas the .htaccess is read and parsed on each and every request even if it's to a static file like images, CSS and JavaScript files).

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

mitokat
Thank you for your fast and very specific reply. I appreciate it!!

Support Information

Working hours: We are open Monday to Friday, 9am to 7pm Cyprus timezone (EET / EEST). Support is provided by the same developers writing the software, all of which live in Europe. You can still file tickets outside of our working hours, but we cannot respond to them until we're back at the office.

Support policy: We would like to kindly inform you that when using our support you have already agreed to the Support Policy which is part of our Terms of Service. Thank you for your understanding and for helping us help you!