Forum for discussing general topics related to Couch.
7 posts Page 1 of 1
Just trying to do pretty urls and following the guide on how to do it and I have enabled it in the config file, generated the htaccess file and uploaded to the root but I am getting internal server error on both back and front end so have tried the test_rewrite test and it says mod rewrite is on so know that's not the issue. I removed the very first line of the generated htaccess file as that worked for someone else using couchcms who had the same issue but still no joy, below is the generated htaccess file. Is there anything I need to change from the htaccess file?

The web server log says /home/techiemonkeyco/public_html/.htaccess: </IfModule> without matching <IfModule> section

Code: Select all
<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]


#DO NOT EDIT BELOW THIS

RewriteRule ^index.php$ "" [R=301,L,QSA]

RewriteCond %{REQUEST_FILENAME} -d [OR]
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule . - [L]

#it-support.php
RewriteRule ^it-support$ "$0/" [R=301,L,QSA]
RewriteRule ^it-support/$ it-support.php [L,QSA]
RewriteRule ^it-support/.*?([^\.\/]*)\.html$ it-support.php?pname=$1 [L,QSA]
RewriteRule ^it-support/([1-2]\d{3})/(?:(0[1-9]|1[0-2])/(?:(0[1-9]|1[0-9]|2[0-9]|3[0-1])/)?)?$ it-support.php?d=$1$2$3 [L,QSA]
RewriteRule ^it-support/[^\.]*?([^/\.]*)/$ it-support.php?fname=$1 [L,QSA]
RewriteRule ^it-support/[^\.]*?([^/\.]*)$ "$0/" [R=301,L,QSA]

#it-disposal.php
RewriteRule ^it-disposal$ "$0/" [R=301,L,QSA]
RewriteRule ^it-disposal/$ it-disposal.php [L,QSA]
RewriteRule ^it-disposal/.*?([^\.\/]*)\.html$ it-disposal.php?pname=$1 [L,QSA]
RewriteRule ^it-disposal/([1-2]\d{3})/(?:(0[1-9]|1[0-2])/(?:(0[1-9]|1[0-9]|2[0-9]|3[0-1])/)?)?$ it-disposal.php?d=$1$2$3 [L,QSA]
RewriteRule ^it-disposal/[^\.]*?([^/\.]*)/$ it-disposal.php?fname=$1 [L,QSA]
RewriteRule ^it-disposal/[^\.]*?([^/\.]*)$ "$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]

#book-it-support.php
RewriteRule ^book-it-support$ "$0/" [R=301,L,QSA]
RewriteRule ^book-it-support/$ book-it-support.php [L,QSA]
RewriteRule ^book-it-support/.*?([^\.\/]*)\.html$ book-it-support.php?pname=$1 [L,QSA]
RewriteRule ^book-it-support/([1-2]\d{3})/(?:(0[1-9]|1[0-2])/(?:(0[1-9]|1[0-9]|2[0-9]|3[0-1])/)?)?$ book-it-support.php?d=$1$2$3 [L,QSA]
RewriteRule ^book-it-support/[^\.]*?([^/\.]*)/$ book-it-support.php?fname=$1 [L,QSA]
RewriteRule ^book-it-support/[^\.]*?([^/\.]*)$ "$0/" [R=301,L,QSA]

#about-us.php
RewriteRule ^about-us$ "$0/" [R=301,L,QSA]
RewriteRule ^about-us/$ about-us.php [L,QSA]
RewriteRule ^about-us/.*?([^\.\/]*)\.html$ about-us.php?pname=$1 [L,QSA]
RewriteRule ^about-us/([1-2]\d{3})/(?:(0[1-9]|1[0-2])/(?:(0[1-9]|1[0-9]|2[0-9]|3[0-1])/)?)?$ about-us.php?d=$1$2$3 [L,QSA]
RewriteRule ^about-us/[^\.]*?([^/\.]*)/$ about-us.php?fname=$1 [L,QSA]
RewriteRule ^about-us/[^\.]*?([^/\.]*)$ "$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>
Hi,

What does the server log report when you use the unedited .htaccess (i.e. without removing the first line)?
I get the following error in the error log when I don't remove the first line

[Sat Mar 30 11:28:35.280028 2019] [core:alert] [pid 2837409:tid 47725601158912] [client 90.192.22.153:53277] /home/techiemonkeyco/public_html/.htaccess: Invalid command '\xef\xbb\xbfOptions', perhaps misspelled or defined by a module not included in the server configuration, referer: https://www.techiemonkey.co.uk/cms/?o=i ... ed1b84fc6/
It could be the BOM error - please see the solution given in the following post
viewtopic.php?f=4&t=53#p271
I looked at the link and tried the various solutions in the post but nothing worked unfortunately
Sorry it was the issue with the .htaccess file, it was as you said KK the BOM issue, in notepad++ I changed it to Encode in utf-8 without BOM and not got the internal server error now
Great! I am glad it helped.
7 posts Page 1 of 1

Who is online

In total there are 5 users online :: 0 registered, 0 hidden and 5 guests
(based on users active over the past 5 minutes)

Users browsing this forum: No registered users and 5 guests