Mobile app version of vmapp.org
Login or Join
Kevin317

: 301 redirect causes issue in web tools for analysis of performance in Pingdom I was googling all over the pages, trying to find what could be wrong before trying to contact the developers at

@Kevin317

Posted in: #Monitoring #Php

I was googling all over the pages, trying to find what could be wrong before trying to contact the developers at tools.pingdom.com, gtmetrix.com, juxseo.com, and other sites.

Since I have changed my .htaccess file to handle the 301 redirection, forwarding mydomain.com to mydomain.com, those web tools do not work proper anymore.

Here is my .htaccess of my php application hosted at cpanel.

IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti* */robots* */oc-admin*

<Limit GET POST>
order deny,allow
deny from all
allow from all
</Limit>
<Limit PUT DELETE>
order deny,allow
deny from all
</Limit>

AuthName mydomain.com
AuthUserFile /host/mycpanelusername/public_html/_vti_pvt/service.pwd
AuthGroupFile /host/mycpanelusername/public_html/_vti_pvt/service.grp

RewriteEngine On
RewriteBase /~mybasefolder/
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /~mybasefolder/index.php [L]
#maybe this is causing issues to pingdom.com
RewriteCond %{HTTP_HOST} ^mydomain.com$
RewriteRule ^/?$ "http://www.mydomain.com/" [R=301,L]
#set the charset and not in html (a best practice)
AddDefaultCharset utf-8


So, anyone maybe could give me a clue?

here is the pingdom result after adding the Rewrite statements

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Kevin317

1 Comments

Sorted by latest first Latest Oldest Best

 

@Jamie184

A 301 redirect should not normally cause pingdom any problems. If it encounters a redirect this should just appear as an additional step in its report.
#maybe this is causing issues to pingdom.com
RewriteCond %{HTTP_HOST} ^mydomain.com$
RewriteRule ^/?$ "http://www.mydomain.com/" [R=301,L]


However, it looks like there is a problem with your redirect. I can't see how this can work... it looks like all requests for mydomain.com (regardless of the URL) would get redirected to your mydomain.com homepage?!

Your .htaccess should read something like:

RewriteCond %{HTTP_HOST} ^example.com [NC]
RewriteRule (.*) www.example.com/ [R=301,L]


The appends the original URL that is requested.

I would also put this above your internal rewrites. (But after your RewriteEngine on)

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme