Problems, need help? Have a tip or advice? Post it here.
6 posts Page 1 of 1
Hi there,

I have setup my site and couch, have it hosted my shared hosting. rewrite_mod is enabled as I have conducted the test.
I am running couch folder in subdirectory of the root (/dev) and the .htaccess file is located within the root.

Everything works fine until I enable PRETTY URL's in the config.php. I only have one page which is a template and clonable (projects.php), and this stops to work once enabled. I can access other pages fine within the same directory (index.html, not a couch file). Of course when PRETTY URL's disabled everything works fine.

.htaccess as follows. Any help would be brilliant.

Code: Select all
Options +SymLinksIfOwnerMatch -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 /dev

#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


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

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

Could you please let me know the non-prettified URL of the problem page that works fine for you? (you may mask the domain name if you wish).

Thanks.
Sorry, I should have stated. The URL which works isn't a couch generated php file its a plain static site. I was just wishing to convey this in case it helped with diagnosing 404 or 500 error.

root
|- dev
| |- couch
| |- projects.php
| |- index.html (non couch file)
|- coming_soon
|- index.html (non couch file)
|- .htaccess (which is what I have posted into from gen_httaccess.php)

So I can access the index.html in the root, and the index.html in /dev with the htaccess file, but can't access projects.php when PRETTY URLS's enabled. When disabled, projects.php opens fine
index.html workings fine (thats the coming soon landing page)
/dev/index.html working fine
/dev/projects.php does not work with PRETTY URL's enabled

Does that make sense?
Thanks.

The "RewriteBase /dev" you have used in the Couch generated .htaccess file is correct but this file is actually supposed to go into the 'dev' folder and not within the 'root' (as indicated by the tree you posted).

Could you please try placing it in 'dev' and see how it goes?
In case there is still any error, please take a look at your web-server's error log and let me know what it reports.
Bingo. Thant has solved it. Thanks.

It was a bit confusing in the documentation as it said the root folder and I was then indicating it to /dev so I thought it was pointing in the right direction.

Thanks again
6 posts Page 1 of 1