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.
tam10

Friendly URLs 500 error

Post by tam10 »

Hi

I'm trying to get friendly URLs working, but when I add an .htaccess file I get a 500 internal server error when I try to view the site. Anybody had this problem before?

Thanks.
Pierre M.

Re: Friendly URLs 500 error

Post by Pierre M. »

yes, everybody with a buggy .htaccess ;-)

How was the install ? Is your site doing well with ugly URLs ? What about the pretty URLs optional setting ?
The .htaccess may require to be tuned to work in your environnement. Please tell us if you have anything specific.

Pierre M.
tam10

Re: Friendly URLs 500 error

Post by tam10 »

The install was fine, and the site works fine with ugly URLs. How can I adjust the .htaccess file to suit my environment? The site is hosted on www.awardspace.com.
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 »

check the server error log. it will tell where the error has happened and will probably narrow the search to one line on .htaccess file
Pierre M.

Re: Friendly URLs 500 error

Post by Pierre M. »

Hello again,

have you followed the optional settings to the letter and used the provided .htaccess ?
Please show an extract of your config.php (URLs section) and your .htaccess

Pierre M.
tam10

Re: Friendly URLs 500 error

Post by tam10 »

Config.php:
#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'] = '.html';

#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';


.htaccess:
Options +FollowSymLinks
RewriteEngine on
RewriteBase /

# 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 ^(.+).html$ index.php?page=$1 [QSA]
Pierre M.

Re: Friendly URLs 500 error

Post by Pierre M. »

Hello again,

Is this the provided .htaccess ?
Your config.php looks good.
As tsw has said above, server error log should help.

Pierre M.
tam10

Re: Friendly URLs 500 error

Post by tam10 »

The .htaccess was one I found on the forums that somebody said worked. Can't remember which thread though.

How do I access the the server error log if it is not my server? It's hosted at www.awardspace.com.
Pierre M.

Re: Friendly URLs 500 error

Post by Pierre M. »

To know how to access the webserver logs, you should ask your hosting provider or read its instructions.
BTW, the provided .htaccess works out of the box for most of people following the optional settings to the letter.

Pierre M.
tam10

Re: Friendly URLs 500 error

Post by tam10 »

I have copied the provided htaccess, and the site no longer gives a 500 server error, but all the links give a 404 page not found now :(
Pierre M.

Re: Friendly URLs 500 error

Post by Pierre M. »

Hello again,

please tell us more : in which folder have you installed CMSms ? (and feel free to give additional information)
And please paste here this simple non 500 error .htaccess Hopefully it only need a little tuning to work for your case.

Pierre M.
tam10

Re: Friendly URLs 500 error

Post by tam10 »

Here is my htaccess:

#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]

CMSms is installed in root/cmsmadesimple/.
Pierre M.

Re: Friendly URLs 500 error

Post by Pierre M. »

tam10 wrote: RewriteRule ^(.+)$ index.php?page=$1 [QSA]

CMSms is installed in root/cmsmadesimple/.
Try to replace by this :
RewriteRule ^(.+)\.html$ index.php?page=$1 [QSA]
or by this :
RewriteRule ^(.+)$ cmsmadesimple/index.php?page=$1 [QSA]
or by this :
RewriteRule ^(.+)\.html$ cmsmadesimple/index.php?page=$1 [QSA]

It can be wrong, I'm tired today...
Pierre M.
Pierre M.

Re: Friendly URLs 500 error

Post by Pierre M. »

...assuming by root/ your mean your www root folder.
tam10

Re: Friendly URLs 500 error

Post by tam10 »

sorry, It's in home/www/(username)/cmsmadesimple.

I tried your suggestions, and I put (username)/ into the line too but that didn't work either. The htaccess file is in the cmsmadesimple sub directory. Is that correct?
Locked

Return to “CMSMS Core”