.htacces redirect issue

Help with getting the CMS CORE package up and running. This does not include 3rd party modules, PHP scripts, anything downloaded via module manager or from any external source.
Locked
zircle
New Member
New Member
Posts: 2
Joined: Mon Oct 20, 2008 5:25 pm

.htacces redirect issue

Post by zircle »

I have a little problem.

Iv'e set up my CMSMS to show "pretty urls"

first i created a .htaccess file and entered the following code:

Code: Select all

# 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]
Then i added these lines to the config.php file:

Code: Select all

$config['assume_mod_rewrite'] = true;
$config['page_extension'] = '/';
$config['internal_pretty_urls'] = false;
$config['use_hierarchy'] = true;
$config['query_var'] = 'page';
The urls were then made "pretty" so this works fine.

Then i added the following lines to the .htacces file to rediret all incoming traffic from domain.com to www.domain.com:

Code: Select all

[b]RewriteEngine on
RewriteCond %{HTTP_HOST} ^domain.com
RewriteRule (.*) http://www.domain.com/$1 [R=301,L][/b]
Below ive added the code so you can see it in context:

Code: Select all

# 301 Redirect all requests that don't contain a dot or trailing slash to
# include a trailing slash
RewriteEngine on
RewriteCond %{HTTP_HOST} ^domain.com
RewriteRule (.*) http://www.domain.com/$1 [R=301,L]
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]
Afteriadding these 3 lines i could no longer log in, when i removed them again i could log in again, so these three lines must do something that causes me to be unable to log in.

Does anyone know how i can solve this problem?
Im not sure which version of php im using but im runnnign MySQL 5.
CMS Made Simple Version : cmsmadesimple-1.4.1-base

Any help will be greatly appreciated :)

Best Regards

Zircle
Last edited by zircle on Wed Oct 29, 2008 7:58 pm, edited 1 time in total.
Pierre M.

Re: .htacces redirect issue

Post by Pierre M. »

not CMSms specific... shouldn't be asked here
Here is a hint.

Pierre M.
Locked

Return to “[locked] Installation, Setup and Upgrade”