Page 1 of 1

htaccess und das Rewritebase

Posted: Wed Apr 15, 2009 7:30 pm
by skibby
Hallo zusammen,

ich brauche einmal eure hilfe. Ich kriegs net hin dabei habe ich das schon xx mal gemacht.

Ich hab die CMSms Seite auf woatec.org/cmsms installiert und abgelegt. Nun taucht jedesmal in der Domain woatec.org/cmsms/.... auf. Das sieht natürlich nicht so schön aus und Google mag das auch net. Mod Rewrite ist soweit aktiviert und läuft auch. Nur eben das "cmsms" stört da.

Problem 2:
Eigentlich hab ich eine Rule eingeführt die besagt: wenn woatec.org dann www.woatec.org. Damit doppelter Content verhindert wird. Auf der Hauptadresse klappt das auch. Sobald ich einen Menü Punkt auswähle ist das www. wieder weg.

Wer kann da helfen??

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

RewriteCond %{HTTP_HOST} ^woatec.org\.de$
RewriteRule ^.*$ http://www.woatec.org%{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>

Re: htaccess und das Rewritebase

Posted: Fri Apr 17, 2009 11:09 am
by skibby
hat da keiner eine Idee zu ?

Re: htaccess und das Rewritebase

Posted: Fri Apr 17, 2009 11:51 am
by Andiministrator
Das mit dem

Code: Select all

/cmsms
stellst Du am besten in den Webserver-Einstellungen um, indem Du dort das DOCUMENT_ROOT auf das CMSms Installationsverzeichnis umstellst. Diese Funktion sollte eigentlich inzwischen jeder Provider anbieten.

Für das mit dem

Code: Select all

www.
kannst Du mal folgenden Inhalt für die .htaccess probieren:

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 /cmsms

# Regel für Umleitung (301) von DOMAIN.DE nach www.DOMAIN.DE
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [NE,R=301,L,NC]

# 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
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ index.php?page=$1 [QSA]

</IfModule>

Re: htaccess und das Rewritebase

Posted: Thu Apr 23, 2009 8:13 pm
by skibby
Ja das funktioniert. Nur dann komme ich nicht mehr in den ADmin Bereich rein. Der nimmt die Anmelde daten nicht an!

Re: htaccess und das Rewritebase

Posted: Thu Apr 23, 2009 8:46 pm
by Andiministrator
Wahrscheinlich musst Du noch in der config.php die $config['root_url'] anpassen, da muss dann das www auch rein. Oder Du nimmst gleich meine Version der config.php ;)

Re: htaccess und das Rewritebase

Posted: Fri Apr 24, 2009 4:44 pm
by skibby
Ja genau in der Config.php stand es falsch drin. Ich danke dir.