Changes to the .htaccess file are not taken into account - .htaccess

I am using Prestashop 1.7.6 on a Debian 10 + HestiaCP and I tried to update the .htaccess of the site to have a better PageSpeed score.
So, I added my cache rules then uploaded the new file. Nothing happened.
I also tried to reload the Prestashop .htaccess from the dashboard and also restarted the apache2 service.
I precise that this .htaccess is, in a way, working because the shop couldn't work without it. However, the changes I made are not taken into account.
Is there a way to activate these changes?

Related

Get a copy of a live Wordpress site to work on localhost with Xampp on Linux

What I'm trying to achieve is to have a local version on my Wordpress site on Linux in order to work locally offline.
So I downloaded my Wordpress site using Filezilla and place it in the htdocs directory. On my Mac it works, I can see the errors to fix in order to adapt it locally. However on Linux it doesn't seem to work the same way. With the same version on my site, instead of going on localhost, it redirects to my live site, which is odd given that everything has been done in the exact same way on the Mac.
Then I tried to reverse the process by installing a fresh copy of Wordpress and copying my custom theme and its plugins (WPML, Custom Field Pro and so on) in their right directories. The thing is I can fix the problem with my first method but with the latter it's getting tricky.
It has to work on Linux which is the machine that will be used in the office.
What do you guys suggest me to do from there? Any information you need please let me know.
Thank you very much in advance,
Julien
[EDIT]
I have changed the first and second row of wp-options in the DB to localhost instead of live URL.
You should try to look in database, Table: wp_options.
You would see siteurl and home.
Then you should change to localhost.
An easier way than manually copying the site is using a plugin called Duplicator, which you can find more info on below:
https://wordpress.org/plugins/duplicator/
This plugin makes it vastly easier to duplicate entire WordPress sites to local machines, without worrying about manually copying the database, core files, themes, etc.
go to phpmyadmin > your database > wp_options check the first two rows of wp_options table it should be siteurl and home you'll see your live site url there replace it with your localhost directory link.
http://example.com change it to localhost/yoursite

.htaccess not working with .cfm pages on Railo

I want to do some very basic .htaccess stuff like block a directory by IP address. I know why this problem is happening, I just don't know how to fix it. I've read every post I can and there doesn't seem to be a consensus on how to fix it. Railo/Tomcat is grabbing control of the page before .htaccess rules are applied.
I am running Centos with Railo / Tomcat / Apache. I believe I am using mod_cfml, at least that's what's under the connector folder.
I have tried putting my .htaccess files in httpd.conf without any luck. I'm not sure I was doing that correctly, but I dropped the code into the virtual domain section of the site I'm working on.
Has anyone got this to work properly?
On iis you can change the order modules run which would solve that issue Asbyou would tell the htaccess module to run before mod_cfml
Can you do that on Apache?

Magento 1.7 - Two magento in one server are effecting each other

I have 2 magento files in one server(linux) , one is live and other one is for testing. Both have different url. The testing magento is just setup by coping the live files and database. But I found out the testing magento will effect the live magento (for example I plugin the new template into testing magento , the live magento css and desgin will run also). Any idea about it?
Make sure that you have updated the URL in all of the config files AND the database. The easiest way to do this is to dump the database of the new site, find and replace the url of the original install with the new one then re-import it.
If you've been consistent with not hard coding links or images in CMS pages then the URL should only appear in these places:
http://www.magentocommerce.com/wiki/1_-_installation_and_configuration/update_site_url_in_core_config_data
You should use one magento on one server. Just create multiple stores in one. and redirect each store you what you want. www.example.com -> store 1; www.example1.com -> store 2 and so on. Magento works faster if you do that way. i have experience with multiple magento on one server. after more people start to use your store then server will start to lag or magento will start to work a lot slower.
this is happening because you have copied the database and files due to which in local.xml and in database table core_config there is information related to your live files, instead you should setup again the TESTING copy, just follow this steps.
take the backup of file local.xml from location /app/etc and after backup delete this file
Now after doing that just access the testing domain, now your setup for testing copy will start.
this will create new configuration information for testing copy

.htaccess, expire headers, and the W3 Total Cache plugin for WordPress

I currently have the W3 Total Cache plugin installed on my self-hosted WordPress site. The question is in regards to the behavior im experiencing with the plugin itself and its relation to the .htaccess file, which is located one-level up of my WordPress core files. I followed the WordPress Codex on moving the core files in its own sub-directory, outside of my root folder.
In any case, the plugin created a bunch of <ifModule> directives, half of which i dont recognize. Im not sure my expire headers are being respected by my CDN -— which it should. I confirmed this using YSlow and WebPageTest, both showed me that none of the files hosted by my CDN have expire headers, despite adding expire headers for all those file types within the plugins settings.
Does it have to do with the location of my .htaccess file and the WordPress core files? Any help is much appreciated.
After talking with customer support over at my CDN's live chat (small chat window, mind you.. but great support), i sort of accepted an inevitable win-lose scenario to this problem. Since all my static files are hosted with them, i used their cache control override feature to set expiry's for me (known as Over-ride Cache Control Header)
Both me and customer support tried several ways to get around W3 Total Cache's settings for caching, none of them worked. It seemed my expiry header directives in my .htaccess file set by the plugin weren't being respected, but all other directives were working fine.
UPDATE: After much research, i found out that my hosting provider doesn't offer mod_expires on shared hosting, it's only available on Virtual Dedicated Server's.

.htacces rewrite to subdomains without wildcard dns

I've googled around quite a bit and also tried some of the solutions I've found. Unfortunately without success. My problem: For a Wordpress install I couldn't do a subdomain setup since I couldn't activate wildcard DNS on my server. This made me set up my Wordpress network install on the main domain and on two subdirectories as below:
domain.be
domain.be/alpha
domain.be/beta
I can however make set subdomains on my server, so I set up the following:
alpha.domain.be
beta.domain.be
I'm now trying to use .htaccess to rewrite this, so that people who go to domain.be/alpha are automatically redirected to alpha.domain.be - and obviously the same for the second (beta) subdirectory. As far as I can see, I should be able to pull this off without using dns wildcards. Unfortunately, I'm too inexperienced with .htaccess rules to pull this off. Anyone out there who can help me with this?
If you have your doubts about this set-up, I'm also interested in hearing about it.
Yeah, it's not gonna work. Mostly becasue the subfolder address is hardcoded in the blog address.
two things you can try:
make manual subdomains and pint the docroot for it at the wordpress install
use the domain mapping plugin to map subdomains to the subfolders. still gotta add each subdomain as a server alias to the same folder as wordpress.

Resources