Problems, need help? Have a tip or advice? Post it here.
9 posts Page 1 of 1
Hello,
I'm trying to enable Pretty Urls. I did turn them to '1' in config, but they are just going to a 404 page now. After enabling http://mysite.com/test_rewrite/rewrite.php it gave me the error:

"HTTP_MOD_REWRITE is not set :-(

Sadly my server host informs me I need to provide my own mod_rewrite code for my .htaccess. Otherwise I would just solve my problem by using this solution:

viewtopic.php?p=11832#p11832.

As a complete newbie to .htaccess I am getting nowhere. I tried the following by the way and it did not work, (the code probably belies just how lost I am!). Any recommends?

RewriteEngine On
RewriteRule ^/blog/([^.]+)$ /blog/$1.php

Thank you much!
Amber
If your using apache2 on the server, you're host should just be able to enable an already included mod_rewrite module using this command:

sudo a2enmod rewrite

Now you need to recognize the use of .htaccess files. Edit the config file so that you're /var/www folder's (where your site will be stored) AllowOveride setting is equal to "All". I just did this tonight on my development server and pretty urls turned on perfectly.

Using the couch/gen_htaccess.php file will spit out the code you need for the .htaccess file. I suspect this might be what they meant when they said you needed to provide your own rewrite code. The rewrite module is already installed if they use apache2.... it's just not turned on by default, and neither is recognition of .htaccess files, sadly :(

Good luck!
Thank you Musman and Cardmaverick,

I should have mentioned that http://www.yoursite.com/couch/gen_htaccess.php is bringing up nothing. Even checking the source code the file is empty.

.htaccess is definitely working because I use it somewhat regularly to block bots and such.

Could someone post what comes up for them with http://www.embodifiy.com/couch/gen_htaccess.php?

Perhaps I can figure out how to modify your gen_htaccess file for my site?
Hi ablase,
This suggests you are not logged-in as super-admin while accessing the URL.

Please follow this sequence and you should get the output -
a. login as super-admin into your admin-panel.
b. manually type or paste the URL of gen_htaccess.php in the address bar of the admin-panel itself (thus bringing up gen_htaccess.php in the very window that has the admin-panel open - this will remove any doubts about the creds you are using to access it).

You should see the contents of .htaccess file in the window now. You are supposed to copy-n-paste this content into the .htaccess file placed in your site's root.

Does this help?
Yes! The gen_access page came up, & has been added to my .htaccess page. But sadly I'm still getting the same error when trying to get to Couchcms pages:

Internal Service Error
The server encountered an internal error or misconfiguration and was unable to complete your request.


My site is not WWW so that has not been uncommented. Is there something else I can do to try to narrow down where the disconnect is happening?

Thank you ~
Please try removing this very first line from the .htaccess file -
Code: Select all
Options +Indexes +FollowSymlinks -MultiViews

If you still get the error, you'll need to take a look at your web server's error log and that would reveal the exact reason.

I must add that I'm going by your statement that
htaccess is definitely working because I use it somewhat regularly to block bots and such.
because you get exactly the error you report when mod_rewrite is not provided by your host (something that http://mysite.com/test_rewrite/rewrite.php seems to be suggesting).

Hope this helps.
Hey this is great! It works. Only problem now is I'm having the same problem as this poster:

viewtopic.php?f=4&t=8804

After deleting the code used to remove .php from non-couchcms parts of site, presto the gen_access.php code worked! Yay!!! Thank you.

But I still want the option to hide .php extensions from my non-couchcms pages. Here is the code I was using to remove .php from rest of the site (which was working fine and except it appeared to have the byproduct of overriding our gen_access code):

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php
Hi,

I've posted a workaround here -
viewtopic.php?p=17555#p17555

Does it help? please let me know.
Thanks.
9 posts Page 1 of 1