Redirect direct access to subfolder

For Joomla! 4.x Coding related discussions, you could also use: http://groups.google.com/group/joomla-dev-general

Moderators: ooffick, General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10.
Post Reply
thodorisgo
Joomla! Apprentice
Joomla! Apprentice
Posts: 38
Joined: Mon Jan 31, 2011 10:30 pm

Redirect direct access to subfolder

Post by thodorisgo » Thu Apr 25, 2024 7:33 pm

Hello.
On my host root i have my main website and there are also some subfolders with some other sites aswell that are related with their own domain names.
I'm looking for a way to block the direct access to those subfolders maybe with a redirect for example www.mainsite.com/othersite to redirect to www.mainsite.com.
Is there a code that i can add to my htaccess file to make this work?

Kind regards

User avatar
Per Yngve Berg
Joomla! Master
Joomla! Master
Posts: 30975
Joined: Mon Oct 27, 2008 9:27 pm
Location: Romerike, Norway

Re: Redirect direct access to subfolder

Post by Per Yngve Berg » Fri Apr 26, 2024 3:35 am

Create the sites as siblings instead of sub-folders.

gws
Joomla! Champion
Joomla! Champion
Posts: 5970
Joined: Tue Aug 23, 2005 1:56 pm
Location: South coast, UK
Contact:

Re: Redirect direct access to subfolder

Post by gws » Fri Apr 26, 2024 5:26 pm

You can password protect directories on the server cpanel.


Post Reply

Return to “Joomla! 4.x Coding”