Pretty URLs problem
Permalink
I know it's been asked before 100 times, and I managed to get it to work on my localhost. But now I've moved my site to a hosting company and can't get it to work. I've read all the related posts here, but didn't have any luck.
mod_rewrite seems to be enabled as the cPanel created a .htaccess file with some rewrite conditions. When I enabled Pretty URLs in the Dashboard, it added the code to the same .htaccess file:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /~temphost/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>
(e.g. my full site root address iswww.www.IP_Address.com/~temphost/)...
When I have that, it says "No input file specified". If I change the RewriteBase to '/', it says "Permission Denied Error".
I've created a php.ini file in the root (www.IP_Address.com/~temphost/) with 'cgi.fix_pathinfo = 0' - no effect.
I've tried some options in .htaccess and php.ini: 'Options +FollowSymLinks' or 'Options -MultiViews' - no effect.
My host is Digital Pacific.
Could anyone help please?
mod_rewrite seems to be enabled as the cPanel created a .htaccess file with some rewrite conditions. When I enabled Pretty URLs in the Dashboard, it added the code to the same .htaccess file:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /~temphost/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>
(e.g. my full site root address iswww.www.IP_Address.com/~temphost/)...
When I have that, it says "No input file specified". If I change the RewriteBase to '/', it says "Permission Denied Error".
I've created a php.ini file in the root (www.IP_Address.com/~temphost/) with 'cgi.fix_pathinfo = 0' - no effect.
I've tried some options in .htaccess and php.ini: 'Options +FollowSymLinks' or 'Options -MultiViews' - no effect.
My host is Digital Pacific.
Could anyone help please?
No, I didn't. I thought the installation script will take care of this. I'll try that. Thanks.
I've checked and the DIR_REL is set correctly to
define('BASE_URL', 'http://Site_IP_Address');
define('DIR_REL', '/~temphost');
And the site's working fine with index.php in the address.
Any other ideas? Thank you.
define('BASE_URL', 'http://Site_IP_Address');
define('DIR_REL', '/~temphost');
And the site's working fine with index.php in the address.
Any other ideas? Thank you.
I've updated configs for a real site, now I get a "No input file specified." BTW, C5 is installed in the site root. So I've commented out DIR_REL.
I've reinstalled C5, re-enabled Pretty URLs and still get "No input file specified" (but it all works with index.php in there). Any other ideas? Thank you.
My host Digital Pacific is just awesome! They respond in no time and they've fixed my URL rewrite problem too. These guys are real pros. They even knew what to do with Concrete5 even though they don't really support it. Tottally impressed.
Anyway, they changed my .htaccess and ./concrete/libraries/request.php files.
.htaccess:
request.php:
And now it all works sweet!
I've updated my Pretty URL solution here:http://www.concrete5.org/index.php?cID=53824...
Anyway, they changed my .htaccess and ./concrete/libraries/request.php 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 --
request.php:
if (!$path) { //$path = Request::parsePathFromRequest('ORIG_PATH_INFO'); $path = Request::parsePathFromRequest('REDIRECT_URL'); }
And now it all works sweet!
I've updated my Pretty URL solution here:http://www.concrete5.org/index.php?cID=53824...
Just a note about this. The above solves the pretty url problem for a 5.4.x site running on Digital Pacific.
For 5.5.x, there doesn't appear to be the need to edit the request.php file, just the .htaccess file.
This .htaccess file works for me:
The only change to what it creates by default is the removal of /$1 from the RewriteRule line.
So far my experience with Digital Pacific has been very good, they run concrete5 really well.
---------
EDIT -- Since 5.5.2.1, there's no longer a need to make this change for Digital Pacific hosting, it works 'out of the box'.
For 5.5.x, there doesn't appear to be the need to edit the request.php file, just the .htaccess file.
This .htaccess file works for me:
# -- 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 --
The only change to what it creates by default is the removal of /$1 from the RewriteRule line.
So far my experience with Digital Pacific has been very good, they run concrete5 really well.
---------
EDIT -- Since 5.5.2.1, there's no longer a need to make this change for Digital Pacific hosting, it works 'out of the box'.
Also, is the site working fine if you include index.php in the address?