Page 1 of 1

[Gelöst] HostEurope und "mod_rewrite

Posted: Thu Sep 03, 2009 9:23 am
by Dani
Hallo zusammen,
ich bin gerade dabei CMSMADESIMPLE aufzusetzen und möchte natürlich auf das Feature "mod_rewrite" von Apache 2.2 nutzen. Da die Suchmaschinen eher mit richtigen URL's anfreunden werden.

Meine config.php sieht so aus:

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'] = 'none';

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

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

#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';
Und hier natürlich noch die .htaccess - Datei:

Code: Select all

Options +FollowSymLinks
  RewriteEngine on
  RewriteBase /tennis/cmsmadesimple/
  
  # ReWrite Rule für News-Feed
  # RewriteRule ^News/rss(.+)$ index.php?page=News/rss$1 [S=1]
 
  # 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] 

# Beginn CMSMS Security Einstellungen.

# Directory Browsing abschalten
Options -Indexes
Options +FollowSymLinks

# Zugriff auf config.php verbieten.

<Files "config.php">
order allow,deny
deny from all
</Files>

# No sense advertising what we are running
ServerSignature Off

# Spambots nach User_agent aussperren
RewriteCond %{HTTP_USER_AGENT} ^.*Whacker.*$ [OR] 
RewriteCond %{HTTP_USER_AGENT} ^EmailCollector [OR]
RewriteCond %{HTTP_USER_AGENT} ^EmailSiphon [OR] 
RewriteCond %{HTTP_USER_AGENT} ^EmailWolf [OR] 
RewriteCond %{HTTP_USER_AGENT} ^.*FileHound.*$ [OR]
RewriteCond %{HTTP_USER_AGENT} ^.*TurnitinBot.*$ [OR]
RewriteCond %{HTTP_USER_AGENT} ^.*JoBo.*$ [OR]
RewriteCond %{HTTP_USER_AGENT} ^.*adressendeutschland.*$
RewriteRule ^.* - [F]

# 1. unterbindet, das fremde Seiten geladen werden
RewriteCond %{QUERY_STRING} ^(.*)=http://(.*) [OR]

# 2. blockiert libwww (Ausgangspunkt f¸r diverse Hackversuche)
RewriteCond %{HTTP_USER_AGENT} ^libwww [OR]

# Blockiert Skripte, die versuchen, base64 encodierten Unsinn via URL zu versenden
RewriteCond %{QUERY_STRING} base64_encode.*\(.*\) [OR]

# Blockiert Skripte, die einen a ********** Tag in der URL enthalten
RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]

# Blockiert Skripte, die versuchen, PHP GLOBALS Variablen via URL zu ver‰ndern
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]

# Blockiert Skripte, die versuchen, eine _REQUEST Variable via URL zu ver‰ndern
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2}) [OR]

# END Optional Settings
CmsMadeSimple liegt nicht direkt im FTP-Root-Verzeichis sondern unter /tennis/cmsmadesimple/.

Wenn ich die Seite aufrufe und über die einzelnen Links fahre, sehe ich dass die URL's brav umgewandelt worden sind. Klicke ich dann einen Menüpunkt an, kommt Fehler 404 - Seite nicht gefunden!

Was habe ich vergessen bzw. übersehen?!


Grüße,
Dani

Re: HostEurope und "mod_rewrite

Posted: Thu Sep 03, 2009 9:35 am
by nicmare

Code: Select all

Options +FollowSymLinks
RewriteEngine on
RewriteBase /tennis/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 ^News/rss(.+)$ index.php?page=News/rss$1 [S=1]
# 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]

Re: HostEurope und "mod_rewrite

Posted: Thu Sep 03, 2009 9:59 am
by Dani
Hi,
Danke für die schnelle Antwort.
Ich habe die .htaccess - Datei entsprechend angepasst - immer noch der gleiche Fehler.

Re: HostEurope und "mod_rewrite

Posted: Thu Sep 03, 2009 1:11 pm
by nockenfell

Code: Select all

$config['url_rewriting'] = 'none';
Hier müsste eigentlich

Code: Select all

$config['url_rewriting'] = 'mod_rewrite';
stehen

Re: HostEurope und "mod_rewrite

Posted: Thu Sep 03, 2009 1:21 pm
by Dani
Hi nockenfell,
Ok...ich habe den Parameter wieder auf "none" gesetzt, damit ich weiterentwickeln kann.  :)
Daran habe ich also schon gedacht.

Re: HostEurope und "mod_rewrite

Posted: Thu Sep 03, 2009 8:10 pm
by nockenfell
Diese Version des .htaccess ist bei mir Momentan im Einsatz. Gerade auf einer alten Seite aktualisiert:

Code: Select all

RewriteEngine on
RewriteBase /

# Beginn Pretty URL

  Options +FollowSymLinks
  
  # ReWrite Rule für News-Feed
  RewriteRule ^News/rss(.+)$ index.php?page=News/rss$1 [S=1]
  
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.+).html$ index.php?page=$1 [QSA] 
Als Dateiendung habe ich .html (Die Sicherheitseinstellungen habe ich hier mal weggelassen. Die kennst du ja alle)

Re: HostEurope und "mod_rewrite

Posted: Thu Sep 03, 2009 8:27 pm
by Dani
Es will einfach nicht funktionieren!
Ich seh in deinem Code-Schnipsel keinen Unterschied zu meiner - bis auf die Reihenfolge.

Re: HostEurope und "mod_rewrite

Posted: Mon Sep 07, 2009 4:36 pm
by Cherry
Welchen Tarif hast du denn?
Unterhalb von Webpack L gibt es keine .htaccess.

Viele Grüße
Cherry

Re: HostEurope und "mod_rewrite

Posted: Mon Sep 07, 2009 9:07 pm
by Dani
Moin Cherry,
wir haben das WebPack M gebucht. D.h. wenn ich auf "L" umsteige funktioniert das alles wunderbar?!

Re: HostEurope und "mod_rewrite

Posted: Tue Sep 08, 2009 6:48 am
by Cherry
das würde ich erwarten,

du hast im Webpack L htaccess features.
Notfalls würde ich den Support mal kontaktieren und direkt nachfragen.

Ich selber benutze keine Pretty URLs ... habe damit also keine direkte Erfahrung.
Allerdings benutze ich andere mod_rewrite  Direktiven und die funktionieren.

Viel Erfolg weiterhin
Cherry

Re: HostEurope und "mod_rewrite

Posted: Fri Sep 11, 2009 3:19 pm
by Dani
Hi,
alles klar. Danke für die Hilfe.