Disable mod_pagespeed (no server conf access, .htaccess doesn't work) - pagespeed

I have a Wordpress site that my client wants to validate perfectly (using W3C validator). One of the issues is Google's pagespeed, which seems to be enabled by default by hosting provider.
I try to disable mod_pagespeed in .htaccess file with the following, but it doesn't work for some reason:
<IfModule pagespeed_module>
ModPagespeed off
</IfModule>
I can disable it by adding "?ModPagespeed=off" to URL, but this does not solve my problem.
Is there anything else I can try? I only have access via FTP (no server conf access, no c-panel access, etc.).

Create a .htaccess file, add below text and upload using ftp program. We are also a hosting provider and use Pagespeed.
Modpagespeed Off

Your URL can accept the PageSpeed query-paramter with an off or on value.
http://www.example.com/index.html?PageSpeed=off
or
http://www.example.com/index.html?q=foo&PageSpeed=off
more here.

Which hosting provider? Can you make sure your server is Apache rather than nginx? nginx doesn't support .htaccess files, though the PageSpeed module is otherwise very similar in function.
Also check out the 'pedantic' filter: https://developers.google.com/speed/pagespeed/module/filter-pedantic, which let's you get all the speed & bandwidth benefits of PageSpeed but still have a validation-clean site.

I had the same issue with my WordPress website, I had installed it on Google Cloud, and by default, the Application installed pagespeed mod for apache. But I found the solution on the Bitnami documentation page.
Check If PageSpeed Is Enabled
execute the command or edit conf file using FTP:
nano /opt/bitnami/apache2/conf/httpd.conf
And if you find these two lines:
Include conf/pagespeed.conf
Include conf/pagespeed_libraries.conf
That means pagespeed mod is enabled.
For Disable PageSpeed
execute the same command or edit conf file using FTP:
nano /opt/bitnami/apache2/conf/httpd.conf
Comment out the following lines as below:
#Include conf/pagespeed.conf
#Include conf/pagespeed_libraries.conf
Now restart the apache server
sudo /opt/bitnami/ctlscript.sh restart apache
Note:-
As above mentioned, the command and the directory location would be changed depending on the Apache server location or your deployment application.
For a detailed article, check out the official Bitnami WordPress Documentation.

Related

Silverstripe install root folder public

I have installed silverstripe 4 into the /var/www/html folder in apache.
However, when I go to the url, I have to use "localhost/public/index.php" in order to obtain the main page. I thought I was to be able to just go to "localhost" to find the defaut page. What am I to do if I want to have a main page without people having to specify "/public/" before it?
Thanks.
Normally, your localhost website can be resolved without adding /public/ if the following 2 things are configured correctly.
Enable Apache mod_rewrite
Having .htaccess rewrite config in /var/www/html
Troubleshooting
Check if you got the right .htaccess in /var/www/html. Basically, this Apache config file will forward all the requests to /public/ folder.
If .htaccess is fine, make sure your mod_rewrite is enabled in your Apache. Check this link.

Wordpress on Nginx server - .htaccess vs. nginx.conf

I have recently changed from Apache to Nginx server and running a Wordpress installation that was migrated onto this new Nginx server.
I only just realised that (the server provider forgot to mention) that the .htaccess file is no longer supported and shouldn't be used with Nginx.
Instead the nginx.conf file should be used. I know I can convert the contents of my current .htaccess file to nginx.conf using one of the convertors, but I don't even have the nginx.conf file.
Can I just create one?? And If I create one, do I place it into the root where currently my .htaccess file is??
Do I then delete the existing .htaccess file?
How should I go about this?
You definitely have nginx.conf - without it, your site wouldn't work. It is in /etc/nginx/ folder, and some additional configs can exist there and in subfolders.
Standard recommendations for WordPress with nginx you can find here in Codex. But if your site works, you have nothing else to do.
Unlike Apache with .htaccess files, nginx does not use any configuration files in WordPress folders. Everything is centralized in /etc/nginx/.
.htaccess files are ignored by nginx and can be deleted or kept in WordPress folders - it doesn't matter.
However, if you have some non-standard tuning in .htaccess files, you should implement relevant directives in nginx conf files. Convertors not very good for it, and produce errors sometimes, unfortunately. You should learn Apache rules used and create similar for nginx by yourself.

Wordpress Permlinks 404 Not Found

I have installed the latest WordPress on my EC2 Ubuntu 13.1 server.
Once I have changed the permlinks to use /%post-name%/, I encounter 404 not found for posts.
I have followed almost everything here, but still having the issue.
http://www.felfelworld.com/2013/02/12/page-not-found-permalink-wordpress/
FYI, I remember I did disable the directory listing for my apache server using SELinux (if I remember it correctly)
in order to have the Permalinks working you need:
Apache web server with the mod_rewrite module installed
The FollowSymLinks option enabled
FileInfo directives allowed
An .htaccess file
You can read more on the codex page.

Migrating Drupal

Currently I have a single drupal site installed on apache 2.2 with php 5.3 on RHEL 6. I am moving servers and am trying to migrate the site. I have imported the database and htaccess, but I cannot access any of the pages other than the root of the site.
You may need to disable clean URLs before exporting the database, try to add ?q= before each path.
That happens when:
a) Apache mod_rewrite is not enabled. If you have root access then do sudo a2enmod rewrite
or
b) .htaccess file at the root folder isn't there, so you need to copy it again.
Here's a troubleshoot check list for mod_rewrite issues:
Make sure Apache's rewrite module is enabled: sudo a2enmod rewrite.
Make sure original .htaccess file is there in the root of your Drupal installation.
Make sure that the existing .htaccess file is getting read by Apache. To test it, add a this line in the beginning of the file and you should get a 500 Internal Server Error: ThisIsReallyABadSyntax.
If the .htaccess file is not in effect, make sure that the AllowOverride directive in the main Apache config file (usually /etc/apache2/httpd.conf on debian-based distros) is set to All. It might be set to None by default.
Finally, make sure that the clean URLs feature is enabled in Drupal settings.
With the phpinfo(); compare all the server specs, just to be sure both server are quite the same or similar.
Steps to migrate Drupal correctly:
Go to Configuration
find Clean URLs
Disable tick inside!
Clean cache!
Download your site file
Download your database
Create new database in your new site
Transfer file and database
Log in
10.Do this step to enable Clean URLs:
It's work 100% guaranteed !
Steps:
1. Download - Dev version (7.x-dev)
2. Find file .htaccess
3. just copy it to your server
4. That's it !

register_globals is enabled. Drupal requires this configuration directive to be disabled

I've just moved my drupal to a new server and I get the following warning:
register_globals is enabled. Drupal requires this configuration directive to be disabled. Your site may not be secure when register_globals is enabled. The PHP manual has instructions for how to change configuration settings. (Currently using PHP register globals Enabled ('1'))
Should I change the configuration of the php server or I can ignore it ?
I probably don't have access to php settings.
thanks
Sadly hostgator leaves them enabled :(
Sometimes making the change in .htaccess is not sufficient. Hostgator has a little elaborate process and it can be irritating some times.
You will need to add the default php.ini file that Hostgator provides to your root. And then add the .htaccess with an entry for the address of php.ini to the www doc root.
For detailed steps and downloading these docs(php.ini and .htaccess file)read my blog on How to turn off register_globals in hostgator
Check with your host if they can help you out. If you don't have access to php.ini then you may not be able to. register_globals has been off for a good number of years now so that's surprising. If the host allows you .htaccess files you can add this to yours:
php_flag register_globals off
I found the solution on a forum.
So just just edit the file / / modules / system system.install then go to line 56:
$requirements['php_register_globals']['severity'] = REQUIREMENT_ERROR;
and replaced by:
$requirements['php_register_globals']['severity'] = REQUIREMENT_WARNING;
Well, that's all, the installation should run perfectly normally.
As for me I think I'll go back nuked klan too uzinagaz this CMS ...

Resources