Pretty URLs on concrete5 5.6.2.1/Apache 2.2.25 (Win32)/PHP 5.3.27

Permalink
I'm running into problems when trying to enable pretty URLs on a site in the environment listed above (404s on every page). The older suggestions for things to try with pretty URLs (most posts dated 2011 or before) aren't particularly relevant anymore ... especially ones that reference modifying libraries/request.php.

Has anyone had any problems enabling pretty URLs with the latest version concrete5? This is running on Windows Server 2012 with Apache 2.2.25 and PHP 5.3.27 as indicated in the subject.

Thanks in advance!

 
planist1 replied on at Permalink Reply
planist1
Not sure if this will help, but I had this same problem, my situation involved running IIS and Apache simultaneously. Eventually I got it working. I changed my .htaccess file to:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME}/index.html !-f
RewriteCond %{REQUEST_FILENAME}/index.php !-f
RewriteRule ^(.*)/$ index.php/$1 [L]
</IfModule>
adamphillips replied on at Permalink Reply
That's actually the same .htaccess file concrete5 generates when I enable pretty URLs. There are all kinds of old posts that suggest changing things in the config/site.php file and things like that ... wasn't sure if anyone had seen anything similar with the newest version of concrete5.
planist1 replied on at Permalink Reply
planist1
Is your C5 install in the root web directory or a sub folder?
adamphillips replied on at Permalink Reply
It's in a subfolder called test (this is a new production web server), but the RewriteBase reflects that subfolder. My .htaccess file looks like this.

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /test/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME}/index.html !-f
RewriteCond %{REQUEST_FILENAME}/index.php !-f
RewriteRule ^(.*)/$ index.php/$1 [L]
</IfModule>
planist1 replied on at Permalink Reply
planist1
Can you post the content (minus username & password) of your config/site.php file?
adamphillips replied on at Permalink Reply
This is my site.php file (with the real values taken out, obviously).

<?php
define('DB_SERVER', 'server');
define('DB_USERNAME', 'username');
define('DB_PASSWORD', 'password');
define('DB_DATABASE', 'database');
define('PASSWORD_SALT', 'password_salt');
?>
planist1 replied on at Permalink Reply
planist1
Just a suggestion, but try adding:

define('DIR_REL', '/test');


to your site.php file.
adamphillips replied on at Permalink Reply
I tried adding it and restarted Apache just to make sure it was aware of these changes (in particular, to .htaccess) ... still nothing.

I also cleared the concrete5 cache to make sure it wasn't still holding onto something old.
planist1 replied on at Permalink Reply
planist1
How about removing the RewriteBase in .htaccess to see if it is conflicting? Then navigate to full URL including the subfolder.

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME}/index.html !-f
RewriteCond %{REQUEST_FILENAME}/index.php !-f
RewriteRule ^(.*)/$ index.php/$1 [L]
</IfModule>
adamphillips replied on at Permalink Reply
Still nothing ... In the Apache error log, I'm seeing this when I have pretty URLs enabled.

File does not exist: D:/www/test/about-us, referer: (URL of site; I would post it, but I'm not allowing it through our firewall yet)

The page I clicked on (that gave me a 404 error) is called About Us and Apache is looking for a file called about-us in the web directory. Now I'm starting to wonder if something in httpd.conf isn't off.
planist1 replied on at Permalink Reply
planist1
To clarify, are you able to get to the login page and log in? What page is loaded when you click on the about-us link?
adamphillips replied on at Permalink Reply
Yes, enabling pretty URLs is the only thing that hasn't worked.
adamphillips replied on at Permalink Best Answer Reply
I figured it out. In case anyone runs into the same problem, the AllowOverride directive CAN NOT be None for pretty URLs to work (in httpd.conf). At minimum, you have to allow use of the directives controlling document types.

See this Apache documentation for more information.

http://httpd.apache.org/docs/current/mod/core.html#allowoverride...
planist1 replied on at Permalink Reply
planist1
Excellent. Glad you got it sorted!