Page 1 of 1

[solved] mod_rewrite not working, htaccess and config.php here

Posted: Mon Mar 29, 2010 12:06 am
by zeroality
I'm not sure if this belongs here or in developer discussion so if I have erred, can someone move this for me? Thanks.

The install in question is http://www.pokemontopaz.net/repository/ which is separate from the CMSMS install set up on the root server. The root server works great - as you can see at http://www.pokemontopaz.net/art/ but this install doesn't.

http://www.pokemontopaz.net/repository/editor/ doesn't work but http://www.pokemontopaz.net/repository/ ... age=editor does. I have set up pretty urls as instructed and it is actually the exact same as what I have in the root install.

config.php pertaining code

Code: Select all

#------------
#URL Settings
#------------

#What type of URL rewriting should we be using for pretty URLs?  Valid options are:
#'none', 'internal', and 'mod_rewrite'.  'internal' will not work with IIS some CGI
#configurations. 'mod_rewrite' requires proper apache configuration, a valid
#.htaccess file and most likely {metadata} in your page templates.  For more
#information, see:
#http://wiki.cmsmadesimple.org/index.php/FAQ/Installation/Pretty_URLs#Pretty_URL.27s
$config['url_rewriting'] = 'mod_rewrite'; // this is new from 1.6

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

#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; // this will be the standard from 1.7

#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 (that's all i have in it)

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]
Both are in the /repository/ directory.

Re: mod_rewrite not working, htaccess and config.php here

Posted: Mon Mar 29, 2010 12:31 am
by replytomk3
RewriteBase /

Change this to
RewriteBase /yourdirectory/

Re: mod_rewrite not working, htaccess and config.php here

Posted: Mon Mar 29, 2010 12:33 am
by zeroality
That did the trick. Thanks!