Page 1 of 1

[solve] pretty URL, how?

Posted: Tue Nov 10, 2009 5:06 pm
by tern
i follow: http://wiki.cmsmadesimple.org/index.php/User_Handbook/Installation/Optional_Settings
but still dont get it.

i change all the settings in config
& i delete the old .htaccess, then rename the htaccess.txt to .htaccess

the url is working, but the page is:

Not Found

The requested URL /en_US/home.html was not found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

Apache/1.3.33 Server at www.boxkator.net Port 80

am i missing something?

pls help me.

Re: pretty URL, how?

Posted: Thu Nov 12, 2009 7:07 pm
by viebig
check if you server supports mod_rewrite

check if .htaccess is located in cmsms root folder (not docs)

if your cmsms install in on a subfolder, change the RewriteBase directive in htaccess to your cmsms relative path

Re: pretty URL, how?

Posted: Sat Nov 14, 2009 3:42 am
by tern
viebig wrote: check if you server supports mod_rewrite

check if .htaccess is located in cmsms root folder (not docs)

if your cmsms install in on a subfolder, change the RewriteBase directive in htaccess to your cmsms relative path
Thanks. now i got a better & clearer information.

I'm hosting at godaddy, & i have email them, they said yes.
& i have move my .htaccess to cmsms root folder.
yes my cmsms install in a subfolder, i hv change the RewriteBase to:
#Sub-dir e.g: /cmsms
RewriteBase /-boxkator (my folder name it is "-boxkator")

Code: Select all

# Attempt to override some php settings, these settings may be helpful on some hosts if your
# default configuration does not meet CMS's minimum requirements, and your host
# has given your account appropriate permissions
#php_value upload_max_filesize "10M"
#php_value session_save_path "tmp/cache"

#php_flag magic_quotes_gpc Off
#php_flag register_globals Off
#php_flag session.use_trans_sid Off

# (this is important, so uncomment if your host permit)
#Options -Indexes
#ServerSignature Off
#
Options +FollowSymLinks
#
<IfModule mod_rewrite.c>
RewriteEngine on
#
#Sub-dir e.g: /cmsms
RewriteBase /-boxkator/

#
# 301 Redirect all requests that don't contain a dot or trailing slash to
# include a trailing slash
# but ignore POST requests.
#RewriteCond %{REQUEST_URI} !/$
#RewriteCond %{REQUEST_URI} !\.
#RewriteCond %{REQUEST_METHOD} !POST$
#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
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ index.php?page=$1 [QSA]
</IfModule>

but now i got a new error:

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, support@supportwebsite.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Apache/1.3.33 Server at www.boxkator.net Port 80

Re: pretty URL, how?

Posted: Sat Nov 14, 2009 4:31 am
by replytomk3
make sure the "RewriteBase /" line is modified to the correct directory. if cmsms is in /cms, then the line must say
RewriteBase /cms (or /cms/ I don't remember)

.htaccess must be in the server root directory, and not cmsms directory (if I am wrong, other people can yell at me)

you can also try internal pretty urls if you give up (people can yell at me again).

Re: pretty URL, how?

Posted: Sat Nov 14, 2009 9:00 am
by tern
Amazing!

i replace with this (no path needed):

Code: Select all

Options +FollowSymLinks
RewriteEngine on

# RewriteCond %{REQUEST_URI} !/$
# RewriteCond %{REQUEST_URI} !/.
# RewriteRule ^(.*) %{REQUEST_URI}/ [R=301,L]

RewriteCond %{REQUEST_FILENAME} !-f [NC]
RewriteCond %{REQUEST_FILENAME} !-d [NC]
RewriteRule ^(.+)$ /index.php?page=$1 [QSA]

# RewriteRule ^index.php$ / [r=301,l]
# RewriteRule ^page/(.+)$ /index.php?page=$1
place this code & done!