Clean URLs

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.
Locked
gerald

Clean URLs

Post by gerald »

First off a HUGE thanks to the CMSMS authors, developers, and community!!

After wrestling for a long while with trying to get Clean URLs working (500 error), I finally have figured out the problem. In my httpd.conf the mod_rewrite.so  module was NOT set to load when Apache was started...

After uncommenting the following line, making the changes according to the "Clean URLs" tutorial in the Tips & Tricks section of DOCUMENTATION, and restarting Apache, it works as expected.

Code: Select all

#LoadModule rewrite_module modules/mod_rewrite.so
change to:

Code: Select all

LoadModule rewrite_module modules/mod_rewrite.so
Perhaps this should be included in the "Clean URLs" tutorial in the documentation?

Is this something commercial webhosts enable by default? I'm using a local version of Apache, MySQL, PHP and not a commercial webhost for learning this great CMS  ;D
stopsatgreen
Power Poster
Power Poster
Posts: 322
Joined: Sat Feb 04, 2006 1:24 am

Re: Clean URLs

Post by stopsatgreen »

Unfortunately I don't have access to my httpd.conf, so I can't get clean URLs :(
stopsatgreen
Power Poster
Power Poster
Posts: 322
Joined: Sat Feb 04, 2006 1:24 am

Re: Clean URLs

Post by stopsatgreen »

Nope. When I change config.php the URLs change to *.html, but as soon as I copy the text from htaccess.txt to .htaccess, I get a 500 server error. Here's how I understand from the instructions what my .htaccess should look like:

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 %{REQUEST_FILENAME} !-f [NC]
RewriteCond % !-f [NC]
RewriteRule ^(.+)\.html$ index.php?page=$1 [QSA]
Is that right?
stopsatgreen
Power Poster
Power Poster
Posts: 322
Joined: Sat Feb 04, 2006 1:24 am

Re: Clean URLs

Post by stopsatgreen »

Just giving this a bump... would appreciate help if available!
Ted
Power Poster
Power Poster
Posts: 3329
Joined: Fri Jun 11, 2004 6:58 pm

Re: Clean URLs

Post by Ted »

There seems to be certain situations where .htaccess can't handle the php_flag stuff.  Try taking those out and see if it helps any.  I wish I had a good explanation as to why it has the problem to begin with.
stopsatgreen
Power Poster
Power Poster
Posts: 322
Joined: Sat Feb 04, 2006 1:24 am

Re: Clean URLs

Post by stopsatgreen »

That works! Great!

What about clean URLs for News stories?

;)
F4n4TiC

Re: Clean URLs

Post by F4n4TiC »

Rear ones, well, on my Apache 2,0,52 (Win32) get I to run.  However not on a Apache 2,0,48 (Linux/Suse)!!!  What can lie???    :( ???
URAN

Re: Clean URLs

Post by URAN »

I`ve read messages at this topic and just wonder if this "mod rewrite" will make my pages looks like .html or .shtml...

Where this module is?  ???

How to activate it?  ???

How to make sure that it works?  ???

Help me, please
Tom

Re: Clean URLs

Post by Tom »

URAN wrote: I`ve read messages at this topic and just wonder if this "mod rewrite" will make my pages looks like .html or .shtml...

Where this module is?  ???

How to activate it?  ???

How to make sure that it works?  ???

Help me, please
Yes, mod_rewrite module is a precondition to have the .html or any other static-looking files, together with the right .htaccess file, which for CMSMS you can find in DOC folder, copy to root folder and rename to .htaccess.
Most good webhosting services have mod_rewrite installed and turned on by default, ask your hosting company.
Locked

Return to “CMSMS Core”