Hi,
I have pretty URLs enabled with CouchCMS, and working correctly, using the code generated by the gen_htaccess script.
I've set up a custom 404.php file for my site, which is working fine when I load it directly (i.e. /404.php), and also when I try to access a known non-existent file with a php extension (e.g. /frog.php).
However, when I type in a known non-existent file with a .html or / extension (e.g. /frog.html or /frog/ ), I get a '401 - authorisation required' message instead of my 404 page. (This also happens if I am not using a custom 404 page.)
My couch subdirectory is htaccess password protected, but the issue persists even when I switch this off.
My theory is that Couch is trying to rewrite these urls using the htaccess rules, and is somehow missing the fact that it's not a valid file (or folder), and so is trying to display a URL for a page/folder that doesn't exist, which is somehow not being caught as a 404.
#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]
Are the htaccess rules creating this problem?
Is there a solution for this?
Do you have any suggestions for things that I can try?
Do you need any more information to better understand the behaviour I'm seeing?
Thank you,
Nikki
I have pretty URLs enabled with CouchCMS, and working correctly, using the code generated by the gen_htaccess script.
I've set up a custom 404.php file for my site, which is working fine when I load it directly (i.e. /404.php), and also when I try to access a known non-existent file with a php extension (e.g. /frog.php).
However, when I type in a known non-existent file with a .html or / extension (e.g. /frog.html or /frog/ ), I get a '401 - authorisation required' message instead of my 404 page. (This also happens if I am not using a custom 404 page.)
My couch subdirectory is htaccess password protected, but the issue persists even when I switch this off.
My theory is that Couch is trying to rewrite these urls using the htaccess rules, and is somehow missing the fact that it's not a valid file (or folder), and so is trying to display a URL for a page/folder that doesn't exist, which is somehow not being caught as a 404.
#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]
Are the htaccess rules creating this problem?
Is there a solution for this?
Do you have any suggestions for things that I can try?
Do you need any more information to better understand the behaviour I'm seeing?
Thank you,
Nikki