Hi ...
My latest client site launched a couple of days ago and all was OK, pretty URLs enabled. But the 404.php page wasn't showing up for a 404 error.
Today I changed the .htaccess file to try out using a full path to 404.php, uploaded the new .htaccess file and got a white screen instead of the website.
I changed the path to 404.php back but still the white screen, commented out the 404 line but still got the white screen. And couldn't log in to the Admin Panel either.
So I had to phone the host - 1and1. Very difficult understanding the person at the other end of the phone. But they uploaded a new .htaccess file which looks like this:
And the site is now viewable and pretty URLs enabled.
But how on earth are pretty URLs working? I am really at a loss to know what is going on here and don't want to upload the previous .htaccess file in case I get back to the white screen with no access to the admin panel!
Any ideas?
The previous .htaccess file is:
My latest client site launched a couple of days ago and all was OK, pretty URLs enabled. But the 404.php page wasn't showing up for a 404 error.
Today I changed the .htaccess file to try out using a full path to 404.php, uploaded the new .htaccess file and got a white screen instead of the website.
I changed the path to 404.php back but still the white screen, commented out the 404 line but still got the white screen. And couldn't log in to the Admin Panel either.
So I had to phone the host - 1and1. Very difficult understanding the person at the other end of the phone. But they uploaded a new .htaccess file which looks like this:
- Code: Select all
AddHandler x-mapp-php5 .php3 .php4 .php .phtml
And the site is now viewable and pretty URLs enabled.
But how on earth are pretty URLs working? I am really at a loss to know what is going on here and don't want to upload the previous .htaccess file in case I get back to the white screen with no access to the admin panel!
Any ideas?
The previous .htaccess file is:
- Code: Select all
Options +Indexes +FollowSymlinks -MultiViews
<IfModule mod_rewrite.c>
RewriteEngine On
#If your website is installed in a subfolder, change the line below to reflect the path to the subfolder.
#e.g. for http://www.example.com/subdomain1/subdomain2/ make it RewriteBase /subdomain1/subdomain2
RewriteBase /
#If you wish to use a custom 404 page, place a file named 404.php in your website's root and uncomment the line below.
#If your website is installed in a subfolder, change the line below to reflect the path to the subfolder.
#e.g. for http://www.example.com/subdomain1/subdomain2/ make it ErrorDocument 404 /subdomain1/subdomain2/404.php
#ErrorDocument 404 /404.php
#If your site begins with 'www', uncomment the following two lines
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
#Prevent Multiple Choices 300 http status code response
CheckSpelling Off
#DO NOT EDIT BELOW THIS
RewriteRule ^index.php$ "" [R=301,L,QSA]
RewriteCond %{REQUEST_FILENAME} -d [OR]
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule . - [L]
#terms-and-conditions.php
RewriteRule ^terms-and-conditions$ "$0/" [R=301,L,QSA]
RewriteRule ^terms-and-conditions/$ terms-and-conditions.php [L,QSA]
RewriteRule ^terms-and-conditions/.*?([^\.\/]*)\.html$ terms-and-conditions.php?pname=$1 [L,QSA]
RewriteRule ^terms-and-conditions/([1-2]\d{3})/(?:(0[1-9]|1[0-2])/(?:(0[1-9]|1[0-9]|2[0-9]|3[0-1])/)?)?$ terms-and-conditions.php?d=$1$2$3 [L,QSA]
RewriteRule ^terms-and-conditions/[^\.]*?([^/\.]*)/$ terms-and-conditions.php?fname=$1 [L,QSA]
RewriteRule ^terms-and-conditions/[^\.]*?([^/\.]*)$ "$0/" [R=301,L,QSA]
#social-media.php
RewriteRule ^social-media$ "$0/" [R=301,L,QSA]
RewriteRule ^social-media/$ social-media.php [L,QSA]
RewriteRule ^social-media/.*?([^\.\/]*)\.html$ social-media.php?pname=$1 [L,QSA]
RewriteRule ^social-media/([1-2]\d{3})/(?:(0[1-9]|1[0-2])/(?:(0[1-9]|1[0-9]|2[0-9]|3[0-1])/)?)?$ social-media.php?d=$1$2$3 [L,QSA]
RewriteRule ^social-media/[^\.]*?([^/\.]*)/$ social-media.php?fname=$1 [L,QSA]
RewriteRule ^social-media/[^\.]*?([^/\.]*)$ "$0/" [R=301,L,QSA]
#qualifications-and-training.php
RewriteRule ^qualifications-and-training$ "$0/" [R=301,L,QSA]
RewriteRule ^qualifications-and-training/$ qualifications-and-training.php [L,QSA]
RewriteRule ^qualifications-and-training/.*?([^\.\/]*)\.html$ qualifications-and-training.php?pname=$1 [L,QSA]
RewriteRule ^qualifications-and-training/([1-2]\d{3})/(?:(0[1-9]|1[0-2])/(?:(0[1-9]|1[0-9]|2[0-9]|3[0-1])/)?)?$ qualifications-and-training.php?d=$1$2$3 [L,QSA]
RewriteRule ^qualifications-and-training/[^\.]*?([^/\.]*)/$ qualifications-and-training.php?fname=$1 [L,QSA]
RewriteRule ^qualifications-and-training/[^\.]*?([^/\.]*)$ "$0/" [R=301,L,QSA]
#privacy.php
RewriteRule ^privacy$ "$0/" [R=301,L,QSA]
RewriteRule ^privacy/$ privacy.php [L,QSA]
RewriteRule ^privacy/.*?([^\.\/]*)\.html$ privacy.php?pname=$1 [L,QSA]
RewriteRule ^privacy/([1-2]\d{3})/(?:(0[1-9]|1[0-2])/(?:(0[1-9]|1[0-9]|2[0-9]|3[0-1])/)?)?$ privacy.php?d=$1$2$3 [L,QSA]
RewriteRule ^privacy/[^\.]*?([^/\.]*)/$ privacy.php?fname=$1 [L,QSA]
RewriteRule ^privacy/[^\.]*?([^/\.]*)$ "$0/" [R=301,L,QSA]
#globals.php
RewriteRule ^globals$ "$0/" [R=301,L,QSA]
RewriteRule ^globals/$ globals.php [L,QSA]
RewriteRule ^globals/.*?([^\.\/]*)\.html$ globals.php?pname=$1 [L,QSA]
RewriteRule ^globals/([1-2]\d{3})/(?:(0[1-9]|1[0-2])/(?:(0[1-9]|1[0-9]|2[0-9]|3[0-1])/)?)?$ globals.php?d=$1$2$3 [L,QSA]
RewriteRule ^globals/[^\.]*?([^/\.]*)/$ globals.php?fname=$1 [L,QSA]
RewriteRule ^globals/[^\.]*?([^/\.]*)$ "$0/" [R=301,L,QSA]
#getting-started.php
RewriteRule ^getting-started$ "$0/" [R=301,L,QSA]
RewriteRule ^getting-started/$ getting-started.php [L,QSA]
RewriteRule ^getting-started/.*?([^\.\/]*)\.html$ getting-started.php?pname=$1 [L,QSA]
RewriteRule ^getting-started/([1-2]\d{3})/(?:(0[1-9]|1[0-2])/(?:(0[1-9]|1[0-9]|2[0-9]|3[0-1])/)?)?$ getting-started.php?d=$1$2$3 [L,QSA]
RewriteRule ^getting-started/[^\.]*?([^/\.]*)/$ getting-started.php?fname=$1 [L,QSA]
RewriteRule ^getting-started/[^\.]*?([^/\.]*)$ "$0/" [R=301,L,QSA]
#explorer.php
RewriteRule ^explorer$ "$0/" [R=301,L,QSA]
RewriteRule ^explorer/$ explorer.php [L,QSA]
RewriteRule ^explorer/.*?([^\.\/]*)\.html$ explorer.php?pname=$1 [L,QSA]
RewriteRule ^explorer/([1-2]\d{3})/(?:(0[1-9]|1[0-2])/(?:(0[1-9]|1[0-9]|2[0-9]|3[0-1])/)?)?$ explorer.php?d=$1$2$3 [L,QSA]
RewriteRule ^explorer/[^\.]*?([^/\.]*)/$ explorer.php?fname=$1 [L,QSA]
RewriteRule ^explorer/[^\.]*?([^/\.]*)$ "$0/" [R=301,L,QSA]
#examples-from-therapy.php
RewriteRule ^examples-from-therapy$ "$0/" [R=301,L,QSA]
RewriteRule ^examples-from-therapy/$ examples-from-therapy.php [L,QSA]
RewriteRule ^examples-from-therapy/.*?([^\.\/]*)\.html$ examples-from-therapy.php?pname=$1 [L,QSA]
RewriteRule ^examples-from-therapy/([1-2]\d{3})/(?:(0[1-9]|1[0-2])/(?:(0[1-9]|1[0-9]|2[0-9]|3[0-1])/)?)?$ examples-from-therapy.php?d=$1$2$3 [L,QSA]
RewriteRule ^examples-from-therapy/[^\.]*?([^/\.]*)/$ examples-from-therapy.php?fname=$1 [L,QSA]
RewriteRule ^examples-from-therapy/[^\.]*?([^/\.]*)$ "$0/" [R=301,L,QSA]
#cookies.php
RewriteRule ^cookies$ "$0/" [R=301,L,QSA]
RewriteRule ^cookies/$ cookies.php [L,QSA]
RewriteRule ^cookies/.*?([^\.\/]*)\.html$ cookies.php?pname=$1 [L,QSA]
RewriteRule ^cookies/([1-2]\d{3})/(?:(0[1-9]|1[0-2])/(?:(0[1-9]|1[0-9]|2[0-9]|3[0-1])/)?)?$ cookies.php?d=$1$2$3 [L,QSA]
RewriteRule ^cookies/[^\.]*?([^/\.]*)/$ cookies.php?fname=$1 [L,QSA]
RewriteRule ^cookies/[^\.]*?([^/\.]*)$ "$0/" [R=301,L,QSA]
#contact.php
RewriteRule ^contact$ "$0/" [R=301,L,QSA]
RewriteRule ^contact/$ contact.php [L,QSA]
RewriteRule ^contact/.*?([^\.\/]*)\.html$ contact.php?pname=$1 [L,QSA]
RewriteRule ^contact/([1-2]\d{3})/(?:(0[1-9]|1[0-2])/(?:(0[1-9]|1[0-9]|2[0-9]|3[0-1])/)?)?$ contact.php?d=$1$2$3 [L,QSA]
RewriteRule ^contact/[^\.]*?([^/\.]*)/$ contact.php?fname=$1 [L,QSA]
RewriteRule ^contact/[^\.]*?([^/\.]*)$ "$0/" [R=301,L,QSA]
#backup.php
RewriteRule ^backup$ "$0/" [R=301,L,QSA]
RewriteRule ^backup/$ backup.php [L,QSA]
RewriteRule ^backup/.*?([^\.\/]*)\.html$ backup.php?pname=$1 [L,QSA]
RewriteRule ^backup/([1-2]\d{3})/(?:(0[1-9]|1[0-2])/(?:(0[1-9]|1[0-9]|2[0-9]|3[0-1])/)?)?$ backup.php?d=$1$2$3 [L,QSA]
RewriteRule ^backup/[^\.]*?([^/\.]*)/$ backup.php?fname=$1 [L,QSA]
RewriteRule ^backup/[^\.]*?([^/\.]*)$ "$0/" [R=301,L,QSA]
#areas-i-may-help-with.php
RewriteRule ^areas-i-may-help-with$ "$0/" [R=301,L,QSA]
RewriteRule ^areas-i-may-help-with/$ areas-i-may-help-with.php [L,QSA]
RewriteRule ^areas-i-may-help-with/.*?([^\.\/]*)\.html$ areas-i-may-help-with.php?pname=$1 [L,QSA]
RewriteRule ^areas-i-may-help-with/([1-2]\d{3})/(?:(0[1-9]|1[0-2])/(?:(0[1-9]|1[0-9]|2[0-9]|3[0-1])/)?)?$ areas-i-may-help-with.php?d=$1$2$3 [L,QSA]
RewriteRule ^areas-i-may-help-with/[^\.]*?([^/\.]*)/$ areas-i-may-help-with.php?fname=$1 [L,QSA]
RewriteRule ^areas-i-may-help-with/[^\.]*?([^/\.]*)$ "$0/" [R=301,L,QSA]
#404.php
RewriteRule ^404$ "$0/" [R=301,L,QSA]
RewriteRule ^404/$ 404.php [L,QSA]
RewriteRule ^404/.*?([^\.\/]*)\.html$ 404.php?pname=$1 [L,QSA]
RewriteRule ^404/([1-2]\d{3})/(?:(0[1-9]|1[0-2])/(?:(0[1-9]|1[0-9]|2[0-9]|3[0-1])/)?)?$ 404.php?d=$1$2$3 [L,QSA]
RewriteRule ^404/[^\.]*?([^/\.]*)/$ 404.php?fname=$1 [L,QSA]
RewriteRule ^404/[^\.]*?([^/\.]*)$ "$0/" [R=301,L,QSA]
#index.php
RewriteRule ^.*?([^\.\/]*)\.html$ ?pname=$1 [L,QSA]
RewriteRule ^([1-2]\d{3})/(?:(0[1-9]|1[0-2])/(?:(0[1-9]|1[0-9]|2[0-9]|3[0-1])/)?)?$ ?d=$1$2$3 [L,QSA]
RewriteRule ^[^\.]*?([^/\.]*)/$ ?fname=$1 [L,QSA]
RewriteRule ^\w[^\.]*?([^/\.]*)$ "$0/" [R=301,L,QSA]
</IfModule>