Pretty URL issues - htaccess rewrite

Permalink
I just moved a bunch of sites from one server to another (both apache) and ran into an issue with pretty URLS on sites using older versions of C5.

clicking on page links kept returning File not Specified.

1. The .htaccess Rewrite provided by the dashboard kept returning 'file not specified' I did find an alternative Rewrite but this gave another problem - the URL in the address bar changed, but the page remained stuck at home page. The only way the site would work for me was to turn off pretty URLs.

My new server is Managed and the Tech was very conscientious and figured out a solution that I wanted to share in case anyone else encountered a similar issue.

The rewrite:

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php/$1 [L

and then go to:

..../concrete/libraries/request.php

change the line below

$path = Request::parsePathFromRequest('ORIG_PATH_INFO');
to
$path = Request::parsePathFromRequest('REDIRECT_URL'); // 'ORIG_PATH_INFO');

This has the redirect working properly.

Hope this might help someone who is encountering a similar issue:-)

splashby
View Replies:
Jonnow replied on at Permalink Reply
Hi Splashby,

Thanks for the post, wondered if you could give me some advice. Having issues with the pretty urls in that it keeps throwing up a 404 every time. I had a look at my requests.php file and the entire contents are as follows:
<?php  defined('C5_EXECUTE') or die("Access Denied.");
class Request extends Concrete5_Library_Request {}


Could you advise where I should be adding that addition please.

Many thanks,

Jonno
splashby replied on at Permalink Reply
splashby
Jonno,

have you checked your .htaccess file is present and correct? I have noticed that on some servers it get's created and added automatically - on my last server environment I had to make one manually and upload.

Michael
Jonnow replied on at Permalink Reply
Yeah, tried that and I've tried changing it to what is suggested online still with no luck. :/
pgee replied on at Permalink Reply
Hi splashby, thanks for your post. I've tried so many htaccess it's getting tedious...I will try this one and the other file - libraries/ request. Just wondered for this file was there meant to be just one close bracket in your code. It seems we're one close bracket short ( or one open bracket too many)

..........hFromRequest('REDIRECT_URL');//'ORIG_PATH_INFO') ??

thanks for clarifying

Phil
splashby replied on at Permalink Reply
splashby
hmmm..not sure as I didn't actually write it and am no code expert...however, I did think the slashes comment out what comes after...but am not sure about that.