Which htaccess code?
Moderator: 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.
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.
- ahdes
- Joomla! Apprentice
- Posts: 17
- Joined: Wed Jan 10, 2007 9:54 pm
- Location: Istanbul
- Contact:
Which htaccess code?
Hi.
How can I prevent accessed at the form of www.sitename.com/~folder/
What is the required htaccess code?
Thanks.
How can I prevent accessed at the form of www.sitename.com/~folder/
What is the required htaccess code?
Thanks.
- CyrusXxX
- Joomla! Enthusiast
- Posts: 236
- Joined: Wed Oct 04, 2017 6:23 am
- Location: Belgrade Serbia
- Contact:
Re: Which htaccess code?
So many options are available to you ahdes here are few:
1. Create htaccess rule and use redirect. Example:
This will prevent access to folder and put up 403 page, but not to files located inside.
2. Create htaccess in that folder and set deny to all rule. Example:
3. If you want to secure it more maybe this also:
You can set file formats match and prevent usage of those files.
Also read this:
www.htaccess-guide.com
1. Create htaccess rule and use redirect. Example:
Code: Select all
RedirectMatch 403 ^/folder/?$
2. Create htaccess in that folder and set deny to all rule. Example:
Code: Select all
Order Allow,Deny
Deny from all
Code: Select all
<FilesMatch "\.(jpg|gif|png|php)$">
Order Deny,Allow
Allow from all
</FilesMatch>
Also read this:
www.htaccess-guide.com
Joomla Serbian Latin Coordinator
https://volunteers.joomla.org/joomlers/ ... oran-nesic
Power is knowledge and knowledge is power.
https://regenesiscomputers.com
https://volunteers.joomla.org/joomlers/ ... oran-nesic
Power is knowledge and knowledge is power.
https://regenesiscomputers.com
- ahdes
- Joomla! Apprentice
- Posts: 17
- Joined: Wed Jan 10, 2007 9:54 pm
- Location: Istanbul
- Contact:
Re: Which htaccess code?
Thank for answer.
But I do not understand my problem.
My site in this folder (~folder)
I want to block access to the site with "~ + site cpanel folder name"
But I do not understand my problem.
My site in this folder (~folder)
I want to block access to the site with "~ + site cpanel folder name"
CyrusXxX wrote: ↑Sun Oct 14, 2018 2:24 pmSo many options are available to you ahdes here are few:
1. Create htaccess rule and use redirect. Example:This will prevent access to folder and put up 403 page, but not to files located inside.Code: Select all
RedirectMatch 403 ^/folder/?$
2. Create htaccess in that folder and set deny to all rule. Example:3. If you want to secure it more maybe this also:Code: Select all
Order Allow,Deny Deny from all
You can set file formats match and prevent usage of those files.Code: Select all
<FilesMatch "\.(jpg|gif|png|php)$"> Order Deny,Allow Allow from all </FilesMatch>
Also read this:
www.htaccess-guide.com
- CyrusXxX
- Joomla! Enthusiast
- Posts: 236
- Joined: Wed Oct 04, 2017 6:23 am
- Location: Belgrade Serbia
- Contact:
Re: Which htaccess code?
Sorry your question was poorly written.
If you want to block your site via cpanel visit your cpanel control panel and depending on what is available to you you will block it.
Still my answer/potential solution is the same make htaccess redirect or simply delete it.
Here is example for domain/subdomain/folder
Code: Select all
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www.)?mainwebsite.com$ [NC]
RewriteCond %{REQUEST_URI} ^/google.com/(.*)$ [OR]
RewriteCond %{REQUEST_URI} ^/something.net/(.*)$
RewriteRule ^(.*)$ - [L,R=404]
or:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www.)?domain.com$ [NC]
RewriteCond %{REQUEST_URI} ^/addonfolder/(.*)$
RewriteRule ^(.*)$ - [L,R=404]
Joomla Serbian Latin Coordinator
https://volunteers.joomla.org/joomlers/ ... oran-nesic
Power is knowledge and knowledge is power.
https://regenesiscomputers.com
https://volunteers.joomla.org/joomlers/ ... oran-nesic
Power is knowledge and knowledge is power.
https://regenesiscomputers.com
- ahdes
- Joomla! Apprentice
- Posts: 17
- Joined: Wed Jan 10, 2007 9:54 pm
- Location: Istanbul
- Contact:
Re: Which htaccess code?
Thank for answer.
for understand my problem, I add link.
True link: http://www.mebakademi.com/hakkimizda/ta ... imler.html
False link: http://www.mebakademi.com/~mebakade/hak ... imler.html
there is "~mebakade" in false link
for understand my problem, I add link.
True link: http://www.mebakademi.com/hakkimizda/ta ... imler.html
False link: http://www.mebakademi.com/~mebakade/hak ... imler.html
there is "~mebakade" in false link
CyrusXxX wrote: ↑Sun Oct 14, 2018 3:45 pmSorry your question was poorly written.
If you want to block your site via cpanel visit your cpanel control panel and depending on what is available to you you will block it.
Still my answer/potential solution is the same make htaccess redirect or simply delete it.
Here is example for domain/subdomain/folderCode: Select all
RewriteEngine On RewriteCond %{HTTP_HOST} ^(www.)?mainwebsite.com$ [NC] RewriteCond %{REQUEST_URI} ^/google.com/(.*)$ [OR] RewriteCond %{REQUEST_URI} ^/something.net/(.*)$ RewriteRule ^(.*)$ - [L,R=404] or: RewriteEngine On RewriteCond %{HTTP_HOST} ^(www.)?domain.com$ [NC] RewriteCond %{REQUEST_URI} ^/addonfolder/(.*)$ RewriteRule ^(.*)$ - [L,R=404]
- CyrusXxX
- Joomla! Enthusiast
- Posts: 236
- Joined: Wed Oct 04, 2017 6:23 am
- Location: Belgrade Serbia
- Contact:
Re: Which htaccess code?
Now I understand your issue ahdes.
Read this topic ahdes:
viewtopic.php?t=808095
You have to set-up a sub-domain or virtual host. For that ask your host.
Or move the Joomla files one folder up :
https://docs.joomla.org/Moving_the_site ... irectories or use backup solutions for that like for example Akeeba backup.
But before that disable url management component you are using on your site ( one which adds .html on the end of urls on your site) just in case if is messing with your site.
Read this topic ahdes:
viewtopic.php?t=808095
You have to set-up a sub-domain or virtual host. For that ask your host.
Or move the Joomla files one folder up :
https://docs.joomla.org/Moving_the_site ... irectories or use backup solutions for that like for example Akeeba backup.
But before that disable url management component you are using on your site ( one which adds .html on the end of urls on your site) just in case if is messing with your site.
Joomla Serbian Latin Coordinator
https://volunteers.joomla.org/joomlers/ ... oran-nesic
Power is knowledge and knowledge is power.
https://regenesiscomputers.com
https://volunteers.joomla.org/joomlers/ ... oran-nesic
Power is knowledge and knowledge is power.
https://regenesiscomputers.com
- ahdes
- Joomla! Apprentice
- Posts: 17
- Joined: Wed Jan 10, 2007 9:54 pm
- Location: Istanbul
- Contact:
Re: Which htaccess code?
thank you very much for your support.
CyrusXxX wrote: ↑Sat Oct 27, 2018 10:16 pmNow I understand your issue ahdes.
Read this topic ahdes:
viewtopic.php?t=808095
You have to set-up a sub-domain or virtual host. For that ask your host.
Or move the Joomla files one folder up :
https://docs.joomla.org/Moving_the_site ... irectories or use backup solutions for that like for example Akeeba backup.
But before that disable url management component you are using on your site ( one which adds .html on the end of urls on your site) just in case if is messing with your site.