Page 1 of 1

.htaccess help when install cms not in root

Posted: Tue Nov 13, 2007 2:02 am
by angelam
hello,

how can i make pretty url without extension like found in http://wiki.cmsmadesimple.org/index.php ... retty_URLs - this works for me if the cmsmadesimple is in root.

Now, my problem is cmsmadesimple program is in another folder like

www.domain.com/cmsmadesimple/

Because in the root, i have another application running.

Any help.

-Angela

Re: .htaccess help when install cms not in root

Posted: Tue Nov 13, 2007 2:22 am
by unknown
Hello,
It should work well for you if you change lines in your current .htaccess file from:

Code: Select all


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

to

Code: Select all


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 ^(.+)$ /cmsmadesimple/index.php?page=$1 [QSA]

This is as per the instructions provided by CMSMS. I say this because there are factors that
may prevent this from working for you (this is the case for me).

HTH, and best wishes.

Re: .htaccess help when install cms not in root

Posted: Tue Nov 13, 2007 8:47 am
by angelam
thanks,

what about this code

Options +FollowSymLinks
RewriteEngine on
RewriteBase /cmsmadesimple/

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

it's working with me, what's shud be the effect... anyway, i'll use your solution because i'm not sure the code above, it's just my experiment.

thanks once again
angela

More power to cmsmadesimple team.

Re: .htaccess help when install cms not in root

Posted: Wed Nov 14, 2007 10:16 pm
by Pierre M.
Hello Angela,

I think you got it with RewriteBase.
You may like the shorter provided .htaccess following this. It doesn't bother with useless trailing slashes and offers true pretty urls : '.html' postfixed.
Have fun with CMSms !

Pierre M.