Problems, need help? Have a tip or advice? Post it here.
3 posts Page 1 of 1
I want my website stored in a subfolder on the webserver. I have enabled the pretty urls and generated a '.htaccess' file with the 'gen_htaccess.php' file from the couch folder. I've stored the '.htaccess' file in de root folder of the webserver and looks like this:

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 /website

#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 /website/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]

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

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

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

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

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

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

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

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


But the file does not link to the subfolder. Do I maybe missing something?
The .htaccess file seems to be fine.

You sure you have done both of the following ? -
a. Placed the generated .htaccess file in your site's root (in your case this would be the subfolder - NOT your web server's root)
b. turned on prettyurls in config.php.

Please let me know. If needed you can PM me your site's FTP + Couch creds.
Thanks.
I had the '.htaccess' file stored in the webserver's root, but I've replaced it to the website's root. But it still doesn't link to the subfolder, i.e. www.freezeforzefestivals.nl/website.

Are you sure to place the '.htaccess' file in the website's root?
3 posts Page 1 of 1