Pretty URLs not working
Permalink 1 user found helpfulWe've tried and tried to get the pretty URL's working on the new Concrete version of our sitehttp://stage.senior-focus.com but to no avail. We've used the .htaccess script provided in the latest version of Concrete5 and written "define('URL_REWRITING_ALL', true);" into the config file. I've seen lots of old forum posts about this issue, but many have said those issues have been resolved in the new versions of Concrete5. Also, the mod_rewrite is active and working on the server.
Please help!

Go to Dashboard > SEO & Statistics > Pretty URLs
Then check Pretty URLs.
Try that first.
FYI, we're running CloudLinux with Apache on a Plesk GUI platform.
define('URL_REWRITING_ALL', true);
to you site.php file. That file is found in your config directory. Try that.
<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 [L]
</IfModule>
I put this code:
define('URL_REWRITING_ALL', true);
in the site.php file in the /config folder as you suggested.
All of that was in place before I put the post on the forum and is where I am at with the issue currently. I believe if these things are done, this the pretty URL's should work with this version of Concrete.
So if I understand correctly, you are trying to "redirect" from
http://example.org/index.php/some-page
to
http://example.org/some-page
Meaning that if someone types the first one into the browser they will get redirected to the second. You might want to bring that up in the Beta Forum for consideration in a future version.
Best Wishes,
Mike
Unfortunately, there can be some variation with various servers and the pretty url .htaccess code. To confirm, is the problem like this?
http://example.org/my-page
Does not work but the one below does?
http://example.org/index.php/my-page
Best Wishes,
Mike
________________________________________
From: concrete5 Community [discussions@concretecms.com]
Sent: Saturday, May 18, 2013 7:33 PM
To: Justin Queen
Subject: Pretty URLs not working : Editing with concrete5
If
http://example.org/index.php/some-page
and
http://example.org/some-page
Both work then your .htaccess file is working as intended.
If that is the case can you be a bit more specific about where you are seeing links that contain index.php where you would rather they didn't?
Best Wishes,
Mike
What needs to be done to make the links called into the URL with "/index.php" dynamically resolve only to the pretty URLs?
Thanks,
Justin
________________________________________
From: concrete5 Community [discussions@concretecms.com]
Sent: Saturday, May 18, 2013 7:54 PM
To: Justin Queen
Subject: Pretty URLs not working : Editing with concrete5
The main domain site is not on the Concrete platform. The sub-domain htaccess is in Concrete. The .htaccess file is also set in the subdomain and will write pretty URLs if entered manually in the address bar, but will not rewrite them automatically when navigation item in website is called or clicked.
I am having the same problems.
Updated the dev version from git just incase someone fixed this bug, so running at latest.
.htaccess #1
<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 [L]
</IfModule>
.htaccess #1
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php [L]
</IfModule>
site.php #1
<?php
define('DB_SERVER', 'localhost');
define('DB_USERNAME', 'root');
define('DB_PASSWORD', '');
define('DB_DATABASE', 'dbname');
define('PASSWORD_SALT', 'v....WlP');
site.php #2
#added
define('URL_REWRITING_ALL', true);
site.php #3
#added
define('SERVER_PATH_VARIABLE', 'REDIRECT_URL');
site.php #4
#added
define('URL_REWRITING_ALL', true);
define('SERVER_PATH_VARIABLE', 'REDIRECT_URL');
both .htaccess files had the same results
When I turn Pretty URL's ON it removes the index,php and EVERYTHING BREAKS (i.e. page not found)
This is the case with both .htaccess files and all site.php files
In addition, I have to restore a backed up copy of the database to get the site back into Pretty URL's=OFF state as I no longer have access to the dashboard.
Has anyone come up with a working .htaccess (or even better, nginx.conf) solution? or is this a code issue?
changing the
AllowOverride None
to
AllowOverride All
in the sites config file
Were you referring to the /config/site.php file to change the AllowOverride to all?
I'm not finding that in the file.
This are the config files for your server (ea Apache or nginx)
usually found in /etc/apache2/
Excample of mine:
items between ** ** are variable and changed for privacy
<VirtualHost *:80> # ServerName **url of site ea www.test.com ** ServerAdmin webmaster@localhost DocumentRoot ** location of your website ea /var/www/ ** <Directory ></Directory> Options FollowSymLinks AllowOverride None </Directory> <Directory ** location of your website with extra / ea /var/www// **> Options Indexes FollowSymLinks MultiViews AllowOverride All <<============================== Here it is!! Order allow,deny allow from all RewriteEngine On
Server crash and I forgot how I had Apache2 set up. This so far was my only unsolvable issue, till now!