Problems, need help? Have a tip or advice? Post it here.
2 posts Page 1 of 1
SOLVED

Hi,

I ran my site on the same domain as a test environment but deeper nested than the root.

Now everything seems to work and I was trying to get it online while copying everything in the root and getting my prettyURLs right. At this final stage I'm struggling for the last few hours...

I'm working in maintenance mode:
Code: Select all
    // 0.
    // Set the follwing to 1 to put your site in maintenance mode.
    // In this mode only admins will be able to access the site while the visitors will be
    // shown the 'Site undergoing maintenance' message.
    define( 'K_SITE_OFFLINE', 1 );


prettyURLs are enabled in the config.php
Code: Select all
    // 8.
    // Set the following to '1' if you wish to enable Pretty URLS.
    // After enabling it, use gen_htaccess.php to generate an .htaccess file and place it in the root folder of your site.
    define( 'K_PRETTY_URLS', 1);


I'm running http://www.mysite.com/couch/gen_htaccess.php afterwards (while logged in as superadmin in couch) and I'm copying the output in a file named .htaccess which is located in the root of the site (the folder before the couch admin map that is).

I'm using
Code: Select all
<cms:show k_site_link />css/style.css
and
Code: Select all
<cms:show k_site_link />js/script.js
where needed.

My css styles didn't break before adding <cms:show k_site_link /> but my webhost does enable MOD_REWRITE (as I know from other couch installs where it did work) and I do see the URL that is named differently then the default links for pages.

If I click the link I get a 404 Not Found error on my pages
Code: Select all
Not Found

The requested URL /projecten/an.html was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

Apache/2 Server at www.mysite.com Port 80


I see that my links are interpreted in a friendly URL but my links aren't showing any result (404 error).
I tried to define the full URL as well (config.php) without luck. Putting prettyURLs off and deleting the htaccess, the site functions like before but without SEO friendly URLs off course.
Code: Select all
 // 1.
    // If neccesary, define the full URL of your site including the subdomain, if any.
    // V.IMP: Don't forget the trailing slash!
    define( 'K_SITE_URL', 'http://www.mysite.com/' );


I deleted all history options in chrome already (from the beginning just to be certain) and rerunning everything, without luck.

my .htaccess file
Code: Select all
Options +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]


#DO NOT EDIT BELOW THIS

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

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

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

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


As a sidenote:
After trying I got a 404 error but saw that prettyURLs do take the filename in the URI, so I renamed my pagename in a somewhat friendlier pagename which caused the template to fail in couch (admin area). I had to manually rename the name in the database: table: couch_templates with the column name. lets say: mypages to another name:projects. After that adjustment couch (admin area) works fine again and output is shown on the front-end back again as well. I suppose this has nothing to do with it but I still struggle with prettyURLs.

Does anyone has any idea that I might be missing?
Thanks in advance.
Too long at work :?

The name of .htaccess was wrong because I couldn't open it in an editor.
Reminder: Be sure to check the filename of your .htaccess file!
2 posts Page 1 of 1
cron