Pretty URLs not working

Permalink 1 user found helpful
Hello everyone,

We'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!

View Replies:
bluzeus replied on at Permalink Reply
My bad, the correct link is:http://stage.senior-focus.com
Blenderite replied on at Permalink Reply
Blenderite
Did you enable Pretty URLS in Concrete5?

Go to Dashboard > SEO & Statistics > Pretty URLs

Then check Pretty URLs.

Try that first.
bluzeus replied on at Permalink Reply
Yes, that has been done.
bluzeus replied on at Permalink Reply
Hey guys, still not working, any ideas?

FYI, we're running CloudLinux with Apache on a Plesk GUI platform.
Blenderite replied on at Permalink Reply
Blenderite
After a little research, I found that you can add
define('URL_REWRITING_ALL', true);

to you site.php file. That file is found in your config directory. Try that.
bluzeus replied on at Permalink Reply
We've already got that in place.
Blenderite replied on at Permalink Reply
Blenderite
In your original question you said that you put it in your .htaccess script. I am referring to the site.php file in the config folder. Is this what you meant by the .htaccess script?
bluzeus replied on at Permalink Reply
Hey there, no that's not what I meant. I put the recommended script (by Concrete when activating pretty URL's) in the .htaccess file. That is below:

<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.
Blenderite replied on at Permalink Reply
Blenderite
Hmm. I am not sure about this. It could be a bug in C5. You could try reporting it here:http://www.concrete5.org/developers/bugs/5-6-1-2/...
mkly replied on at Permalink Reply
mkly
Ok, by design the .htaccess file rewrites those, but does not redirect those. That is how it is intended to work at this time.

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
Scafidi454 replied on at Permalink Reply
Scafidi454
Worked like a charm "remove index.php from URLs"
mkly replied on at Permalink Reply
mkly
Hello,
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
bluzeus replied on at Permalink Reply
Not exactly sure what you're asking, but if you are asking if the "/index.php" is showing up in our URL's when pretty url's is enabled, then yes, that is correct.
________________________________________
From: concrete5 Community [[email protected]]
Sent: Saturday, May 18, 2013 7:33 PM
To: Justin Queen
Subject: Pretty URLs not working : Editing with concrete5
mkly replied on at Permalink Reply
mkly
Actually, no what I was asking is if the link doesn't work or if you are seeing links that have the index.php in it.

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
bluzeus replied on at Permalink Reply
I am seeing the links with the "/index.php" manually removed work just fine. (Such ashttp://stage.senior-focus.com/senior-web-experts/)....

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 [[email protected]]
Sent: Saturday, May 18, 2013 7:54 PM
To: Justin Queen
Subject: Pretty URLs not working : Editing with concrete5
Adreco replied on at Permalink Reply
Adreco
Just at quick glance, it appears your .htaccess is set to write pretty url's for your main domain but not for the subdomain you're using ?
bluzeus replied on at Permalink Reply
Hello,

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.
ntisithoj replied on at Permalink Reply
ntisithoj
I am postign here and in dev...

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?
ntisithoj replied on at Permalink Reply
ntisithoj
I had the same problems, as have many other I see... and what fixed it was..
changing the

AllowOverride None

to

AllowOverride All

in the sites config file
alsworld replied on at Permalink Reply
Thanks. It helps to turn Rewrite on :)
mroberte replied on at Permalink Reply
Ntisithoj,

Were you referring to the /config/site.php file to change the AllowOverride to all?

I'm not finding that in the file.
StillD replied on at Permalink Reply
Me neither! I'm still having this problem... Hope some one got an answer. There are 2 files in my config folder: site.php and site_theme_paths.php
wvanelten replied on at Permalink Reply
He ment he changed the AllowOverride None to AllowOverride All in the httpd.conf (sites-available/default in my case)

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
mdius replied on at Permalink Reply
This is what I was missing!

Server crash and I forgot how I had Apache2 set up. This so far was my only unsolvable issue, till now!