Bitnami wordpress htaccess.conf setup - wordpress

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.

Related

location of .htaccess in bitnami wordpress

i am not able to find the location of .htaccess file in bitnami wordpress. Need to enable content scripting policy in .htaccess file. But this file doesnot exits in nginx bitnami wordpress. Could anyone please help to resolve.
Bitnami Engineer here,
The .htaccess files are used by Apache to modify the configuration of the application per directory. We do not suggest any user use them because of security and performance reasons. However, you are asking about the WordPress with NGINX solution. NGINX doesn't make use of the .htaccess files so if your plugin/theme needs any custom configuration, you will need to include it inside the NGINX conf. There is a specific configuration file for WordPress at /opt/bitnami/apps/wordpress/conf/nginx-app.conf.
I hope this information helps.
Check Here
<Directory "/opt/bitnami/apps/wordpress/htdocs/">
Your code here
</Directory>

How to move wordpress website from hosting account to localhost

I'm getting 404 error while accessing relative paths on
Wordpress website copied from hosting and deployed locally as Apache vhost.
Local website is basically git clone of the existing remote website.
The following steps were performed to make it work:
DB urls were searched and replaced using wp-cli to be http://local.webiste.com
VHost configured according to apache documentation.
/etc/hosts modified.
So website can be accessed successfully via http://local.website.com.
Media in http://local.website.com/wp-content/uploads/2017 can be viewed successfully.
Though, accessing a Wordrpess page identified by /relative path (relative to current domain/site) causes "The requested URL /relative/ was not found on this server" error.
I'm using the same .htaccess from the remote public_html folder.
How to achive equivalent to hosting behaviour for local vhost website?
Is .htaccess, apache2 configuration, vhost configurations should be changed?
You can use the WP Migrate DB plugin to fix URLs and PHP paths, and them you need to fix the .htaccess file (PHP path) and maybe wp-config.php.
The solution was to allow using .htaccess in /etc/apache/apache2.conf by changing from AllowOverride None to AllowOverride All.
More about it here
So that section related to my local website now looks like:
<Directory /var/www/local.webiste.com/public_html>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
Allow from 127.0.0.1
</Directory>
Please take a backup through Wordpress Duplicator/All in one migration plugin
For Duplicator plugin kindly follow that https://wordpress.org/plugins/duplicator/
For All in one migration plugin please follow that https://wordpress.org/plugins/all-in-one-wp-migration/
After backup simply you can create a folder in htdocs folder in xampp then create the database in localhost phymyadmin with same name that you have assign to folder
Then further implementation of the backup you can follow the above links please
You can easily move your WordPress website from any hosting to your local host such xampp or wamp server, etc. Follow these simple steps:
Open your WordPress website dashboard.
Install the duplicator backup plugin.
Once it is installed. Take a backup of all of your database files, themes, plugins, and everything.
Open your localhost Cpanel and upload the backup zip file into public.html folder.
Congrats. You have successfully moved your website.
I hope this information will help you. Thanks

Htaccess on XAMPP local server for testing

I finally got the XAMPP local Wordpress system working so now I can test things out.
If I want to mimic htaccess files to test redirect code and so forth - especially htaccess in the root - here would I put the htaccess file?
I'm thinking is the XAMPP folder considered the "root"? I've taken a snapshot of my directories to give you an idea. The checkmarks are there just to show you the general layout of the directories.
One other thing - suppose I wanted to create a sub-directory (like localhost/sub/index.php) to test in XAMPP. Is this possible? I noticed when I'm in local host there is no multi-site capability. Thoughts?
Thanks
The .htaccess file should be in the root of your WordPress installation and you may use sub-directories to create more local sites. For example:
localhost/wordpress = xampp/htdocs/wordpress/index.php
localhost/anothersite = xampp/htdocs/anothersite/index.php
// More...
For the WordPress installation, put the .htaccess in the wordpress directory in example (At the same level where the index.php file is stored).

404 error on drupal after migrating

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.

Wordpress permalinks broken

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.

Resources