Friendly URLs 500 error

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Pierre M.

Re: Friendly URLs 500 error

Post by Pierre M. »

Hello,

assuming
1°)home/www/(username)/ is your w3 root directory (you browse it with http://www.foobar.net/ )
2°)and your have unpacked CMSms in it and it has created home/www/(username)/cmsmadesimple/
3°)and you installed by browsing to http://www.foobar.net/cmsmadesimple/index.php
4°)and this has redirected you to http://www.foobar.net/cmsmadesimple/install/install.php
5°)and http://www.foobar.net/cmsmadesimple/ should be the base URL for your site

then
1°)the provided .htaccess works for installs in the root folder
2°)your config.php seems ok
3°)try to add this line in your .htaccess after RewriteEngine On :

Code: Select all

RewriteBase /cmsmadesimple
If
alternate 5°)your want http://www.foobar.net/mypage.html URLs (without /cmsmadesimple/)
then
put the .htaccess in the root w3 folder and please retry my hints redirecting to the cmsmadesimple folder :

Code: Select all

RewriteRule ^(.+)$ cmsmadesimple/index.php?page=$1 [QSA]
OR
RewriteRule ^(.+)\.html$ cmsmadesimple/index.php?page=$1 [QSA]
Pierre M.
tsw
Power Poster
Power Poster
Posts: 1408
Joined: Tue Dec 13, 2005 10:50 pm
Location: Finland

Re: Friendly URLs 500 error

Post by tsw »

when one gets 500errors it is crucial to see the apache error log.

otherwise we are shooting with a shotgun...
tam10

Re: Friendly URLs 500 error

Post by tam10 »

Pierre M. wrote: Hello,

assuming
1°)home/www/(username)/ is your w3 root directory (you browse it with http://www.foobar.net/ )
2°)and your have unpacked CMSms in it and it has created home/www/(username)/cmsmadesimple/
3°)and you installed by browsing to http://www.foobar.net/cmsmadesimple/index.php
4°)and this has redirected you to http://www.foobar.net/cmsmadesimple/install/install.php
5°)and http://www.foobar.net/cmsmadesimple/ should be the base URL for your site

then
1°)the provided .htaccess works for installs in the root folder
2°)your config.php seems ok
3°)try to add this line in your .htaccess after RewriteEngine On :

Code: Select all

RewriteBase /cmsmadesimple
If
alternate 5°)your want http://www.foobar.net/mypage.html URLs (without /cmsmadesimple/)
then
put the .htaccess in the root w3 folder and please retry my hints redirecting to the cmsmadesimple folder :

Code: Select all

RewriteRule ^(.+)$ cmsmadesimple/index.php?page=$1 [QSA]
OR
RewriteRule ^(.+)\.html$ cmsmadesimple/index.php?page=$1 [QSA]
Pierre M.
You're a genius! It works perfectly now! Thanks for all your help!

Tom
Pierre M.

Re: Friendly URLs 500 error

Post by Pierre M. »

Thank you Tom !-)

Please share this success : tell us if your case is "5" or "alternate 5" and which one is the solution (RewriteBase or which RewriteRule)

Pierre M.
tam10

Re: Friendly URLs 500 error

Post by tam10 »

Code: Select all

RewriteBase /cmsmadesimple
This one worked for me.
DW
Forum Members
Forum Members
Posts: 15
Joined: Thu Dec 06, 2007 2:42 pm

Re: Friendly URLs 500 error

Post by DW »

I'm having the same problem  :'(

I'm running Apache on a windows machine for local testing.

The CMSMS works fine without the friendly urls.

This is config file
#------------
#URL Settings
#------------

#Show mod_rewrite URLs in the menu? You must enable 'use_hierarchy' for this to work for modules
$config['assume_mod_rewrite'] = true;

#Extension to use if you're using mod_rewrite for pretty URLs.
$config['page_extension'] = '/';

#If you don't use mod_rewrite, then would you like to use the built-in
#pretty url mechanism?  This will not work with IIS and the {metadata} tag
#should be in all of your templates before enabling.
$config['internal_pretty_urls'] = true;

#If you're using the internal pretty url mechanism or mod_rewrite, would you like to
#show urls in their hierarchy?  (ex. http://www.mysite.com/parent/parent/childpage)
$config['use_hierarchy'] = true;

#If using none of the above options, what should we be using for the query string
#variable?  (ex. http://www.mysite.com/index.php?page=somecontent)
$config['query_var'] = 'page';

this is .htaccess
Options +FollowSymLinks
RewriteEngine on
RewriteBase /cmsmadesimple          (I tried this with / also, same result)

# 301 Redirect all requests that don't contain a dot or trailing slash to
# include a trailing slash
RewriteCond %{REQUEST_URI} !/$
RewriteCond %{REQUEST_URI} !\.
RewriteRule ^(.*) %{REQUEST_URI}/ [R=301,L]

# Rewrites urls in the form of /parent/child/
# but only rewrites if the requested URL is not a file or directory
RewriteCond %{REQUEST_FILENAME} !-f [NC]
RewriteCond %{REQUEST_FILENAME} !-d [NC]
RewriteRule ^(.+)$ index.php?page=$1 [QSA]

the error log says the following for apache
[Thu Dec 06 22:41:05 2007] [error] [client 127.0.0.1] File does not exist: C:/Program/Apache Software Foundation/Apache2.2/htdocs/cmsmadesimple/niftyCorners.css, referer: http://localhost:8080/cmsmadesimple/index.php


I just get the Page not found :'( Anything that I missed? do I have to activate something in the apacheserver maybe?

Regards,
[glow=red,2,300]DW[/glow]
Pierre M.

Re: Friendly URLs 500 error

Post by Pierre M. »

Hello DW,

thank you for reporting precisely.
DW wrote: I'm having the same problem  :'(

I'm running Apache on a windows machine for local testing.

The CMSMS works fine without the friendly urls.

#Extension to use if you're using mod_rewrite for pretty URLs.
$config['page_extension'] = '/';

# 301 Redirect all requests that don't contain a dot or trailing slash to
# include a trailing slash
RewriteCond %{REQUEST_URI} !/$
RewriteCond %{REQUEST_URI} !\.
RewriteRule ^(.*) %{REQUEST_URI}/ [R=301,L]
This is not what is suggested by the official .htaccess.
DW wrote: $config['internal_pretty_urls'] = true;
Oops, some bug in the doc : you should enable EITHER mod_rewrite OR internal rewrite. I suggest

Code: Select all

$config['internal_pretty_urls'] = false;
to solve your issue.

Pierre M.
DW
Forum Members
Forum Members
Posts: 15
Joined: Thu Dec 06, 2007 2:42 pm

Re: Friendly URLs 500 error

Post by DW »

Made some changes

.htaccess (Copied the example file in doc directory)
#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 %{REQUEST_FILENAME} !-f [NC]
RewriteCond %{REQUEST_FILENAME} !-d [NC]
RewriteRule ^(.+)$ index.php?page=$1 [QSA]

config.php
#------------
#URL Settings
#------------

#Show mod_rewrite URLs in the menu? You must enable 'use_hierarchy' for this to work for modules
$config['assume_mod_rewrite'] = true;

#Extension to use if you're using mod_rewrite for pretty URLs.
$config['page_extension'] = '/';

#If you don't use mod_rewrite, then would you like to use the built-in
#pretty url mechanism?  This will not work with IIS and the {metadata} tag
#should be in all of your templates before enabling.
$config['internal_pretty_urls'] = false;

#If you're using the internal pretty url mechanism or mod_rewrite, would you like to
#show urls in their hierarchy?  (ex. http://www.mysite.com/parent/parent/childpage)
$config['use_hierarchy'] = true;

#If using none of the above options, what should we be using for the query string
#variable?  (ex. http://www.mysite.com/index.php?page=somecontent)
$config['query_var'] = 'page';

Also these setting is in apache config

LoadModule rewrite_module modules/mod_rewrite.so


    Options FollowSymLinks
    AllowOverride All
    Order deny,allow
    Deny from all
    Satisfy all


sitll get the same error  :'(
what setting did I miss?
DW
Forum Members
Forum Members
Posts: 15
Joined: Thu Dec 06, 2007 2:42 pm

[SOLVED] Friendly URLs 500 error

Post by DW »

I did find some more "AllowOverride" in apache config to set to All
and also changed default directory file from index.html to index.php and now it works.

Thanks all
Pierre M.

Re: Friendly URLs 500 error

Post by Pierre M. »

Hello again,

Cool you have solved your issue.
DW wrote: #Extension to use if you're using mod_rewrite for pretty URLs.
$config['page_extension'] = '/';
I think

Code: Select all

$config['page_extension'] = '.html';
delivers prettier URLs.
But this is my opinion and you may like it another way.
Have fun with CMSms

Pierre M.
Locked

Return to “CMSMS Core”