I use VPS hosting and Debian, then i installed Wordpress. I upload file in one specific file and unfortunately it is accessiblevia browser:
qartulad.online/wp-content/movies/2018/
People can access to every file on this directory. But people cannot access to other Wordpress directory:
qartulad.online/wp-content/
How can i block access to my specific directory too?
How is the access on this domain blocked?
ftp01.srulad.net/hd3/cfb32710293800d2c041409ae665c998/
You have multiple ways to do this.
You can do it on the server level via the httpd.conf or .htaccess. (httpd is the best spot to do it)
In the httpd.conf
Look for Options Indexes FollowSymLinks
Change it to Options FollowSymLinks
In the .htaccess add before the WordPress block.
Options -Indexes
There are also plugins that will do it. iTheme Security has more or less a one click that does a lot of the basic security like directory surfing etc.
Related
my website www.auzcan.com 's homepage is showing 404 error, however other pages are working fine after installation of SSL certificates from GoDaddy. I've tried every solution available here but all in vain. Looking forward for help from your end. Thanks in Advance.
Try checking what your front page is set to in Admin panel-> Settings-> Reading.
It should either have the your latest posts option selected, or the static page option selected and the front page set to a valid page.
it might be a case of not having a home page set correctly
I had exactly the same problem and the solution for me was to add these lines to /etc/apache2/sites-enabled/default-ssl.conf, which is my SSL-enabled website's configuration file:
<Directory /var/www/html/>
AllowOverride All
</Directory>
Of course, this assumes DocumentRoot /var/www/html. Change accordingly if is this is different in your setup.
The thing is that Wordpress uses .htaccess rules to process the URLs and for them to work, AllowOverride All needs to be in the server's configuration file.
In my situation, the configuration for the non-SSL and SSL-enabled variants were in a separate files. The non-SSL configuration had AllowOverride All all along, and so everything was working fine. Once I had enabled the SSL, the other configuration file came into play and didn't have the required AllowOverride All setting.
I migrated a website from one web host to another (which is Google Cloud), but I'm having problems changing my permalinks from plain to post name. I want to have the website show the name of the page on the url, but I can't figure out how to get access to my .htaccess files on Google Cloud to see if this is the cause of it.
The error on the website pages are 404 Not Found. But the pages are found if the permalinks are on plain and not on %postname%.
I'm working on a wordpress file.
I tried to change permalinks to %postname% in the wordpress dashboard, but I received an error. I also tried to see if plugins were an issue but its the permalinks needed to be on "plain" setting.
Access SSH: Go to edit your apache .conf
sudo nano /etc/apache2/apache2.conf
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride ALL <----(edit from none)
Require all granted
</Directory>
Then restart apache2 using:
sudo service apache2 restart
I had the same issue, I hired someone to move a client site (tenwitch.com) to GCP, and when it is time to adjust some little stuffs. I decided to do it myself only to find out that it is not the traditional cpanel I am used to. What you are going to do is download filezilla (https://filezilla-project.org/download.php) and PuTTY, there are tutorial online to follow. You will be able to set it up instantly.
I am using xampp to develop a wordpress site using bitnami application installer all is fine at the moment except that there is no .htaccess file but instead they are using a htaccess.conf file. would i be able to create a .htaccess file in order to allow .svg mime type? or is there a way to do that with the htaccess.conf file?
I appreciate the help :)
Bitnami developer here:
One of our main goals is to configure Bitnami applications in the most secure way. For this reason, we moved the configuration in the ".htaccess" files to the main application configuration files and set the "AllowOverride" option to "None" by default.
In this case, you have two options:
Set the AllowOverride directive to All in xampp_dir/apps/wordpress/conf/httpd-app.conf and use the .htaccess files.
Use xampp_dir/apps/wordpress/conf/htaccess.conf with the content of the .htaccess files that you have.
I hope it helps.
I have a Drupal website in the internet.
I want to work on local from now, so I install Wamp, I copy-pasted the apache filesystem of the website and made a sql dump with phpmyadmin.
I re-create the same database on phpmyadmin with the same name & datas than on the web.
Now, I can access to the main page (the ). All is ok, i see a node, I see the whole menu with links, ...
When I try to navigate or log, it give me 404 error, what is wrong? URL sounds great, when I try ti access to anode with the nodeid, 404 again.
I suspect WAMP but I don't know how fix that problem!
Thanks a lot to help me!
Make sure mod_rewrite is enabled - it isn't enabled by default on WAMP.
You can find instructions on how to do so here.
Most likely you have AllowOverride set to None in Apache. I believe that is the default, and it will prevent your .htaccess files from working (These are the files that make your URLs work).
Edit your Apache config file, search for every instance of AllowOverride and change it to "All", E.g:
AllowOverride All
Also make sure you actually copied the .htaccess file down, sometimes it's hidden.
Make sure you have uploaded the .htaccess file to Drupal's root directory.
Or try to access your website with ?q=, like: http://site.com/?q=admin
Have you installed the local site in a sub folder? What's the local URL?
If the site is located in a subfolder, e.g. http://localhost/drupal, you'll need to add (or uncomment) a line in .htaccess that tells apache about the RewriteBase.
AllowOverride was set to None in my httpd.conf. Changing to AllowOverride All worked like a charm.
Remember to restart apache after the change.
I have recently moved my blog from one serever to another. I am now unable to restore my permalink structure.
Now my permalink strucure has become /?p=123. Whenever, I try to change it to any other custom permalink structure, it throws 404 for all the posts. Check the blog at http://microreviews.org
I have been forced to make the permalink structure as /?p=123. All the entries from search engines are however on the old structure /%postname%/
None of the plugins for the same seem to work and I am stuck with the ?p=123 structure.
What should I do?
Assuming you're on Apache server:
You don't have the .htaccess file on the new server, or
the new server doesn't have mod_rewrite turned on, or
the new server ignores the .htaccess files, or
any combination of the above :)
The other option instead of using .htaccess (although Wordpress is built around modifying that file) you can take the contents of the .htaccess file and add them to a directive in your httpd.conf (or virtual host config file). This approach requires more access to your apache installation (i.e. it might not work with some hosting solutions), but according to the Apache httpd documentation it's more secure and less work on the server since apache will scan every directory for .htaccess files each time a page is accessed and it will re-load the .htaccess file(s) every time the page is accessed as well. If the access is put into the server config then it is loaded once at apache start-up (or on a server reload) and that's it.
For example:
If your .htaccess file contained the following for the /www/htdocs/example directory
AddType text/example .exm
Then the following in your httpd.conf file would be equivalent
<Directory /www/htdocs/example>
AddType text/example .exm
</Directory>
The approach of editing your main configuration instead of .htaccess does not require that you specify AllowOverride to something other than None.
In this case, you'll still need mod_rewrite enabled for permalinks to work correctly.