I've tried a million different Apache config combinations none of which worked. But I've finally nailed it! And not a single manual/instruction/howto I saw has EVER mentioned to add that damn 'Options +FollowSymLinks' line to the config!
I'm running Apache2 on openSUSE 11.2 - just to let you know your Apache config files may be in a different place on a different distro.
As root
1. I checked if I had a mod_rewrite module running by
~>a2enmod -l
No it wasn't
2. I've enabled the mod_rewrite module by
~>a2enmod rewrite
3. Restarted Apache
~>/etc/init.d/apache2 restart
4. Checked again, yes, now it was ON
5. On openSUSE I edited /etc/apache2/httpd.conf and added this under the default directory:
<Directory "/srv/www/htdocs/c5">
Options +FollowSymLinks
AllowOverride all
Order deny,allow
Allow from all
RewriteEngine On
</Directory>
6. Then I enabled Pretty URLs in the Concrete5 Dashboard - Sitewide Settings, clicked Save
7. Then I copied the required code for an .htaccess file:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /c5/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>
8. Then I went to my C5 server folder /srv/www/htdocs/c5 and created a .htaccess text file and pasted that code into it
9. Restarted Apache server
~>/etc/init.d/apache2 restart
10. Went to my site, refreshed it, clicked all links and now they all worked!
And Joomla and Drupal are also doing Pretty URLs, I just changed the <Directory "/srv/www/htdocs"> to point to the main server root instead of the c5 folder.
If you're on a real host provider and URL rewrite still doesn't work, instead of the above steps you may try just changing these two files:
.htaccess:
# -- concrete5 urls start --
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
#RewriteRule ^(.*)$ index.php/$1 [L]
RewriteRule .* index.php/$1 [L]
</IfModule>
# -- concrete5 urls end --
concrete/libraries/request.php:
if (!$path) {
//$path = Request::parsePathFromRequest('ORIG_PATH_INFO');
$path = Request::parsePathFromRequest('REDIRECT_URL');
}
Here's more information about mod_rewrite:
http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html...
Hope this helps.
PS. I don't understand why Pretty URLs are shown as folders rather than files, e.g. a .../c5/articles/press-room/article1.php is shown as c5/articles/press-room/article1/? But, if it help Google to do its thing, I don't really care.
About pretty URLs as folders, the / in between the words really doesn't relate in anyway to folders.
I recently used CodeIgniter and before it Django and it's all the same.
The URLs don't have any thing to do with folders.