Page 1 of 1

.htaccess URL verschönerung

Posted: Sat Sep 18, 2010 4:26 pm
by Publisher
Hallo zusammen. Ich habe alles nach Anleitung gemacht, aber ich kriegs doch nicht hin irgendwie.

Ich habe CMS MS 1.6.6 und möchte das nur zb index.html nach der Domain steht

config.php konfig:

Code: Select all

#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'] = '.html';

#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

Code: Select all

Options +FollowSymLinks
RewriteEngine on
RewriteBase /dates/CMSMS1.6.6/

# 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 ^(.+).htm$ index.php?page=$1 [QSA] 
Was mache ich falsch?

Re: .htaccess URL verschönerung

Posted: Sat Sep 18, 2010 4:31 pm
by cyberman
Zunächst der (obligatorische) Hinweis, dass du auch Sicherheitsgründen auf die 1.6.8 aktualisieren solltest ;).

Bin zwar kein mod_rewrite Profi, könnte ich mir aber vorstellen, dass das

Code: Select all

RewriteBase /dates/CMSMS1.6.6/
in die Hose geht, weil Punkte hier eine eigene Bedeutung haben. Versuch mal

Code: Select all

RewriteBase /dates/CMSMS166/
(musst natürlich deine gesamte Konfiguration anpassen)

Re: .htaccess URL verschönerung

Posted: Sun Sep 19, 2010 5:22 pm
by Publisher
Werde ich dann mal probieren, aber stimmt es das ich keine neue .htaccess Datei mehr im Root erstellen muss? Zieht er es wirklich von der vordefinierten Datei unter /root/doc/ ? Was eine .txt Datei ist.

Re: .htaccess URL verschönerung

Posted: Mon Sep 20, 2010 2:01 pm
by NaN
Publisher wrote: Werde ich dann mal probieren, aber stimmt es das ich keine neue .htaccess Datei mehr im Root erstellen muss? Zieht er es wirklich von der vordefinierten Datei unter /root/doc/ ? Was eine .txt Datei ist.
Sorry, aber woher hast Du denn diesen Blödsinn?
Wäre mir wirklich neu.
Du kannst die htaccess.txt als Vorlage nehmen.
Aber mehr auch nicht.

Re: .htaccess URL verschönerung

Posted: Mon Sep 20, 2010 4:03 pm
by cyberman
Es kommt darauf an, wie deine URL aussehen soll.

CMSms hat ein internes System zur "URL-Verschönerung". Wenn dir das nicht reicht, musst du es über den Server machen, also mod_rewrite / .htaccess.

Re: .htaccess URL verschönerung

Posted: Fri Sep 24, 2010 7:26 am
by gbock
ich hatte gestern auch damit rumprobiert und final festgestellt, dass (in einem Fall!!!) die .htaccess nicht ins root sondern in den unterordner muss, in dem das cms liegt.

Vom Hoster aus wird nämlich schon direkt in das unteverzeichnis gerootet :-)