Plesk Mod Rewrite Problem

Permalink
I am testing Concrete5 and have had it working locally. Just trying it on my shared hosting which runs on plesk. All installed ok but I cant get Pretty URLs to work.

Looking through the forums I have tried adding a php.ini file, and also making the change to the htaccess and the change in site.php however it doesnt seem to be fixing the problem.

Any ideas?

View Replies:
TheRealSean replied on at Permalink Reply
TheRealSean
Strange we have our accounts on Plesk and they seem to run ok,

are you able to use the htaccess to do any redirecting?
matthull replied on at Permalink Reply
Yep htacess works
TheRealSean replied on at Permalink Reply
TheRealSean
And if you add the following to your htacess file can you access the short urls without enabling friendly urls?

ie the link is still /index.php/page
can you access just /page
(Without Friendly URLs enabled)
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>
matthull replied on at Permalink Reply
Hi TheRealSean,

Diabling ‘Enable Pretty URLs’ and adding this htaccess to the root of my folder (trialling in a subfolder) the page is still coming up as: index.php/about/
dantheman replied on at Permalink Reply
dantheman
Hi I am not sure if this will help you but I am on Plesk and it has always worked for me.

First tick the box to enable the pretty URLs. This seems to create an htaccess file. Then replace the contents of the htaccess file with the following:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* /redirect.php/$1 [L]
</IfModule>


and you need to add an entirely blank file called 'redirect.php' at the site root.

Kind regards

Dan
matthull replied on at Permalink Reply
Hi Dantheman,

I am trialling this concrete5 install in a subfolder. Adding this, to the concrete5 folder doesn’t seem to do anything, adding it to the folder above simply took the site to the index page of the domain.
matthull replied on at Permalink Reply
Looking through the forums, I wonder if this problem has been fixed in the svn version of concrete5. Referencing this post:http://www.concrete5.org/developers/bugs/5-4-1-1/pretty-urland039s-... I am going to try the svn version to see if this is working.
matthull replied on at Permalink Reply
I have tried the SVN, and unfortunately this is still a problem I am getting. Not sure what to do. Htaccess is certainly updating, but it isn't making a difference and still showing "No input file specified." Any help would be really appreciated
Vanfenix replied on at Permalink Reply
Hi Matthul,

I understand that you're having problems. I had the same issues before. I'm running off a new host now that specializes in custom php files for C5 - so it's running like a charm.

Here's a few things for you to look at.

First - your .htaccess file.

Clear out whatever is in there and replace it with this.

# -- concrete5 urls start --
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>
# -- concrete5 urls end --

The second thing is that you'll want to edit is your public_html/config/site.php

Use this here.

<?php
define('DB_SERVER', 'localhost');
define('DB_USERNAME', 'your db username');
define('DB_PASSWORD', 'Your db password');
define('DB_DATABASE', 'Your db name');
define('BASE_URL', 'http://iamparanoidsocantgiveittoyou.com');
define('REDIRECT_TO_BASE_URL', true);
define('DIR_REL', '');
define('PASSWORD_SALT', 'Put your SALT KEY here.');

Leave the PHP tag Open.
If you dont have a "Salt Key" - then delete it.

Anyways - that should do the trick.
Make sure you dont touch that "pretty url enable/disable" button in the dashboard after you've done the changes. It should be enabled before you start.

If this saved you time and worked - I do accept Beer Donations. j/k

Van
TheRealSean replied on at Permalink Reply
TheRealSean
Working from that bug note you linked to make sure you do NOT have safe mode turned on.

If adding the ? didnt solve it it is possible that mod re_write is not enable or you are not allowed to run this (most host will allow this) but worth a check.

If you do have safe mode of you can disable it in your domain host settings.
matthull replied on at Permalink Reply
Okay, Finally, I have the modrewrite working by setting up a new hosting account in my plesk account set up as Apache module and PHP safe mode on.

Unfortunately on install all images failed, even though all the the folders (files, Packages, and config) are set to 777 and my browsers cache has been emptied.

When I try and upload any images they fail with an error.
I really need some help with the upload and set up of concrete5 as I keep running into problems. Any ideas?
Vanfenix replied on at Permalink Reply
Please provide me with the error message that you are receiving.
Also did you setup the files like I said?
matthull replied on at Permalink Reply
“unable to copy file to storage directory. Please check permissions on your upload directory and ensure they can be written to by your web server”

I have double checked that my upload directory permissions is 777, cleared cache and tried again. Is this possibly because php safe mode is on?
Vanfenix replied on at Permalink Reply
In the Dashboard, Sitewide Settings, Debug tab, Cache, Clear Cache.
do that for me and see if there's any difference.

If not - then Drop me a copy of your php.ini

Also the /public_html/files folder needs to have Write access to it.

permissions are 755 Don't make it 777 (make sure you do it Recurssive)
Also make sure that PHP Safe Mode is turned OFF

The other thing you can do which would help.
Make a file in your public_html folder called phpinfo.php
In that folder put in this code
<?php phpinfo() ?>

http://mysite.com/phpinfo.php will now show your php settings which makes it easier to see if anything is out of place.
matthull replied on at Permalink Reply
Hi Vanfenix,

By turning off phpsafemode, I am now able to upload files, and the mod rewrite seems to be working when I create new pages.

All of this makes little sense as the same set up before, only it was running in a subfolder rather than from the main directory.

Site seems slow at the moment even after clearing the cache, and as the example content is not present from the set up, and neither is the tmp folder. I am thinking of deleting the whole install, clearing the database and trying the install from scratch again to see if this speeds up the page loading.

Also I noticed that there is no php.ini file in this site, could this help with the speed?

Thank you for your help, still unsure on the set up problems, and hope that I can get it running at a reasonable speed.
Vanfenix replied on at Permalink Reply
Well the speed really depends on how much ram and CPU etc. are in use.

I use a Dedicated Hosting company as I know C5 uses a lot of juice. The company I'm with has 2 Gigz of ram dedicated just to run scripts in C5. My sites are pretty damned fast - much quicker then when I used to have them on hostgator or godaddy.

If you find your sites are slow - then I would change hosts. You pay a little more, but it's worth it in the end.

What part of the world do you live in?
matthull replied on at Permalink Reply
I'm in the UK,

I am running Wordpress and other sites and not had any problems with speed.

Is there anything that can be done with php.ini or htaccess to speed up the loading, like you would do with wordpress. e.g: memory_limit = 32M.

I just wondered as there isnt a php.ini file present at the moment.
Vanfenix replied on at Permalink Reply
You definitely have a php.ini file - you just might not have access to it.

That Memory Limit Cvar is inside of the php.ini
Raise that to 256MB and that will help you a great deal.
TheRealSean replied on at Permalink Reply
TheRealSean
You could also try the Miser script, that will consolidate the scripts and css into single files helping to save time loading those in.

The core c5 team are unable to load it into the core as it is not mit licensed so they are working on their own version but the miser script is very good. You just need permission from the author to use it on your site.(If you are running it for commercial use non-commercial I believe is fine)

http://www.concrete5.org/community/forums/customizing_c5/miser-web-...

we use ukfast for our sites, both concrete and bespoke and rarely have a problem with them, and when we do their customer service is very good.
http://www.ukfast.co.uk