Page 1 of 1

mod_rewrite problem

Posted: Fri Nov 04, 2005 9:55 am
by miss_d_bus
using the mod_rewrite, my files are now .php but I cant access the admin area any more. I get this error:

Warning: Smarty error: unable to read resource: "db:admin/index" in /usr/local/psa/home/vhosts/kentradiohire.co.uk/httpdocs/TEST/lib/smarty/Smarty.class.php on line 1088

Any ideas what might be wrong?

Thanks.

Re: mod_rewrite problem

Posted: Fri Nov 04, 2005 7:02 pm
by sjg
Could you post your mod_rewrite rules, so we can see exactly what's being rewritten?

Re: mod_rewrite problem

Posted: Fri Nov 04, 2005 9:40 pm
by miss_d_bus
Here it is for the .htaccess:

Code: Select all

php_flag magic_quotes_gpc Off
php_flag register_globals Off
php_flag session.use_trans_sid Off

# Make sure you have Options FollowSymLinks
# and Allow on
RewriteEngine On

#Rewrites page.shtml as index.php?page
RewriteCond % !-f [NC]
RewriteRule ^(.+)\.php$ index.php?page=$1 [QSA]
For the config.php file:

Code: Select all

$config['page_extension'] = '.php';
I think thats all of it.
Thanks.

Re: mod_rewrite problem

Posted: Fri Nov 04, 2005 9:53 pm
by sjg
Ah, OK. I understand what's going on. When you try to get into the admin, it's still doing the rewriting. The solution is to put another .htaccess file in your admin directory. That .htaccess file should look like:

Code: Select all

RewriteEngine Off
That should make it work.

Good luck!
___Samuel___

Re: mod_rewrite problem

Posted: Fri Nov 04, 2005 10:25 pm
by miss_d_bus
Thank you!
yes that worked perfectly :D
Now CMSMS will do exactly what I need :)

Re: mod_rewrite problem

Posted: Fri Oct 20, 2006 11:56 am
by miss_d_bus
Does this work any more ?
I cannot get it to work with the current version of this cms.

thanks,
Catherine

Re: mod_rewrite problem

Posted: Fri Oct 20, 2006 2:29 pm
by Pierre M.
What are you talking about ?
Front end URL rewriting OR back end URL not rewriting ?
Both are quite independant of the version of CMSms. You should not have any trouble.
Please describe your problem : CMSms version, URL rewriting options, config parameters...

PM

Re: mod_rewrite problem

Posted: Fri Oct 20, 2006 3:00 pm
by miss_d_bus
i have an existing website where the files are filename.php as the files are static.
I am converting the website over to the cms and want to retain the same file names so it is front end url rewriting i am after.
I am using the latest version of cms under apache and linux.

Since the config.php file no longer contains the parameter:
$config['page_extension'] = '.php';

I wondered if it was obsolete, and if so, what would i do to achieve what i require?


Thanks,
Catherine

Re: mod_rewrite problem

Posted: Fri Oct 20, 2006 5:50 pm
by Pierre M.
I don't think the page extension is obsolete. May be your new installation has a problem with its config.php. I think you should erase all cmsms.php and reinstall 1.0.2 from scratch. Or may be the php handler catches the request before the rewrite ?

According to http://wiki.cmsmadesimple.org/index.php ... l_Settings , once you have set up your .htaccess, you can achieve what you do with :
$config['assume_mod_rewrite'] = true;
$config['internal_pretty_urls'] = falsee;
$config['page_extension'] = '.php'; (your trick)
$config['use_hierarchy'] = true; (as you wish, this is my favorite)

I'm sure it is possible to make the ".php site" you describe by properly configuring the php handler, the rewrite and cmsms config. But I would not recommend that. I understand you want to keep your URLs, but may I suggest another (may be simpler) way to do it :
-build the new website with a nice long term URL scheme. I mean ".html" or ".xhtml" extensions.
-use the webserver mod_rewrite to send 301 (permanently moved) responses for any request to your existing ".php" URLs, redirecting properly search engines and users from /path/to/existing/page.php to /path/to/existing/page.html

PM

Re: mod_rewrite problem

Posted: Sun Oct 22, 2006 9:37 am
by miss_d_bus
Thanks for that.
I think i got the config settings a bit wrong.
I'll try it when i get back to work


Thanks