5.7.5.2 - Pretty Urls Disaster

Permalink 2 users found helpful
Concrete5 5.7.5.2 / Fruitful theme / Linux / Apache

Problem: Had a nearly completed website, attempted to enable Pretty Urls and mod .htaccess, etc. Now I can only see the /index.php and /login pages - if I click a link on index.php or sign in, I receive a nice 404;

Object not found!
The requested URL was not found on this server. The link on the referring page seems to be wrong or outdated. Please inform the author of that page about the error.
If you think this is a server error, please contact the webmaster.
Error 404

Question: Of course, *now* I read all of the people who have had difficulty with this feature. Of course, my last backup was just after Concrete5 was installed. Everything was nearly perfect until I decided to try Pretty Urls. I just want to go back to have a working site (forget pretty urls - I'd rather have a working site!); but I don't see it documented for 5.7. I have undone most of the changes I made outside the admin dashboard - however I don't know what to modify within mysql/concrete5 by hand when there is no admin dashboard available. Does anyone have any ideas on how I can go back?

 
rge replied on at Permalink Reply
Hi,

You can remove the following from the .htaccess

# -- concrete5 urls start --
<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>
# -- concrete5 urls end --
ksalisbury replied on at Permalink Reply
Thank you for the reply! I have actually deleted the .htaccess file completely and restarted apache. Should I recreate an empty one?
rge replied on at Permalink Best Answer Reply
In the generated_overrides you can find the option 'url_rewriting' set this to 0.

path: application/config/generated_overrides/concrete.php


You can also try this:
1. Login sitename.com/index.php/login
2. Go to the dashboard sitename.com/index.php/dashboard
3. edit the settings for the removal of index.php
ksalisbury replied on at Permalink Reply
Thanks, rge! I had seen this posted before for older C5 versions, but find and grep would not show me anywhere url_rewrite existed on my server. However when I opened concrete.php, I *did* find "url_rewriting" and I set that to 0. Assuming this is what you meant, it seems to work just fine now. I post this for others who might have the same problem I did. Thank you so much!

),
'seo' => array(
'canonical_url' => 'http://www.mydomain.com',
'canonical_ssl_url' => '',
'redirect_to_canonical_url' => 0,
'url_rewriting' => 0,
ksalisbury replied on at Permalink Reply
To further clarify a bit, if I manually enter a page name like;

http://www.mydomain.com/index.php/mypage...

I can see the pages fine. However all links are broken due to the removal of index.php. An no matter what I try, I can not seem to get past a token error after attempting to login to the dashboard.

Kevin
kspitzley replied on at Permalink Reply
kspitzley
I had the exact same issue. I downloaded a copy of my 5.7.5.2 c5 site onto XAMPP, and after clearing out my htaccess file, modifying my generated overrides file like this post suggests, I was still having the problem. What I had to do is, add my cannonical URL to the generated overrides file and set the redirect to true like this:

'seo' => array(
'canonical_url' => 'http://localhost/myurl',
'canonical_ssl_url' => '',
'redirect_to_canonical_url' => 1,
'url_rewriting' => 0,
'tracking' => array(
'code' => '<script>

Then i was able to log in and click on links.

I also changed my cache settings and cleared my cache.
Frisbeeld replied on at Permalink Reply
Frisbeeld
It seems that I got the same problem in version 5.7.5.6. I tried your solution but it didn't work. Tried to remove the .htacces had no effect either. Really frustrating.

Anyone who has another solution?
jayholcombfrost replied on at Permalink Reply
I'm having the same issue in 5.7.5.9. Any updates??
Thanks!
anete replied on at Permalink Reply
anete
I too am having the same problem 5.7.5.7
I have done this process successfully many times, but for some reason this time it's causing an issue.
I have a site just about ready to go live and was just tweaking things but now unable to login.

Any assitance please?
jayholcombfrost replied on at Permalink Reply
Until you fix the issue you should be able to login at domain.com/index.php/login.

I put a fresh C5 install and still had the problem, so next step is looking at the server environment
leegold replied on at Permalink Reply
This helped me:

https://www.digitalocean.com/community/tutorials/how-to-set-up-mod_r...

I only added the entry they cited to 000-default.conf.

And, I think (so far) pretty urls works now.
stewblack23 replied on at Permalink Reply
stewblack23
Just had this same issue on my local development environment using MAMP Pro.

Just go into applications\config\generated_overrrides/ folder

In the concrete.php file look for the this section of code and deleted it.

'seo' => [
'redirect_to_canonical_url' => 0,
'url_rewriting' => true,
],

Then clear your browser catch and login back in. The site should come back up and pretty URL is now turned off.
publicb replied on at Permalink Reply
hi!
I have the same issue, also of course shortly before going live with a site.

here's what my .htaccess (placed in the root folder of concrete5) looks like.

<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>


and here's an excerpt of application/config/generated_overrides/concrete.php

'seo' => array(
        'canonical_url' => '',
        'canonical_ssl_url' => '',
        'redirect_to_canonical_url' => 0,
        'url_rewriting' => 0,



has anyone solved this without having to do a clean install? my client already has his content on this site :/
publicb replied on at Permalink Reply
Solved by taking the following steps.

1. Backup and then delete the .htaccess file in the root folder of the faulty installation

2. Replace /application/config/generated_overrides/concrete.php with the file from my working development environment.

The 'seo' Part in said file now looks like this.

'seo' => array(
        'canonical_url' => '',
        'canonical_ssl_url' => '',
        'redirect_to_canonical_url' => 0,
        'url_rewriting' => 0,
    ),


That was super scary. I will now try switching Pretty URLs (url_rewriting) back on.
hrcv replied on at Permalink Reply
hrcv
This was the best solution for me. But guys be careful of your browser cache. That make me lost a good amount of time redoing the same clears.
mehreenbaakza replied on at Permalink Reply
mehreenbaakza
For anyone who encounters this problem

1. You need to follow the steps posted by publicb and then the site will return to normal.

2. Then, to actually turn on pretty URLs, you need to go into system settings and turn off all cache settings. This is really important.

2. Once you do so, attempt to turn on pretty URLs again in the system settings, and it should work.

3. If the settings page generates code for you to paste into your .htaccess file, be mindful to only copy the version for your server type.