[Opgelost] pretty urls
Posted: Wed Jan 14, 2009 9:15 pm
Ik krijg het maar niet voor elkaar om pretty URL's correct aan de gang te krijgen.
Mijn belangrijkste 'houvast' http://wiki.cmsmadesimple.org/index.php/FAQ/Installation/Pretty_URLs heeft me aardig op weg geholpen, alleen die laatste stap.... (om grijze haren van te krijgen)
- Ik heb cmsms geïnstalleerd in /cmsms
- Hieronder een stukje uit mijn config.php
- Hieronder mijn .htaccess
De pagina's zijn keurig aan te roepen met /naam.html zoals ik het zou willen.
Alleen als er een menu gekozen wordt komt er weer /cmsms/naam.html in de url.
Hoe krijg het voor elkaar om ook hier het /cmsms/ te laten verdwijnen ?
Mijn belangrijkste 'houvast' http://wiki.cmsmadesimple.org/index.php/FAQ/Installation/Pretty_URLs heeft me aardig op weg geholpen, alleen die laatste stap.... (om grijze haren van te krijgen)
- Ik heb cmsms geïnstalleerd in /cmsms
- Hieronder een stukje uit mijn config.php
Code: Select all
#-------------
#Path Settings
#-------------
#Document root as seen from the webserver. No slash at the end
#If page is requested with https use https as root url
#e.g. http://blah.com
$config['root_url'] = 'http://<domein>/cmsms';
if(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS']=='on')
{
$config['root_url'] = str_replace('http','https',$config['root_url']);
}
#Path to document root. This should be the directory this file is in.
#e.g. /var/www/localhost
$config['root_path'] = '/home/httpd/vhosts/<domein>/httpdocs/cmsms';
#Name of the admin directory
$config['admin_dir'] = 'admin';
#Where do previews get stored temporarily? It defaults to tmp/cache.
$config['previews_path'] = '/home/httpd/vhosts/<domein>httpdocs/cmsms/tmp/cache';
#Where are uploaded files put? This defaults to uploads.
$config['uploads_path'] = '/home/httpd/vhosts/<domein>/httpdocs/cmsms/uploads';
#Where is the url to this uploads directory?
$config['uploads_url'] = $config['root_url'] . '/uploads';
Code: Select all
php_value register_globals off
DirectoryIndex index.html index.htm index.php
#BEGIN Optional settings
# Turns off directory browsing
# not absolutely essential, but keeps people from snooping around without
# needing empty index.html files everywhere
Options -Indexes
# Deny access to config.php
# This can be useful if php ever breaks or dies
# Use with caution, this may break other functions of CMSms that use a config.php
# file. This may also break other programs you have running under your CMSms
# install that use config.php. You may need to add another .htaccess file to those
# directories to specifically allow config.php.
<Files "config.php">
order allow,deny
deny from all
</Files>
# Sets your 403 error document
# not absolutely essential to have,
# or you may already have error pages defined elsewhere
ErrorDocument 403 /forbidden403.shtml
# No sense advertising what we are running
ServerSignature Off
# END Optional Settings
# BEGIN CMSMS and Rewrite Rules
# Make sure you have Options FollowSymLinks
# and Allow on
RewriteEngine On
# Might be needed in a subdirectory
RewriteBase /cmsms/
# URL Filtering helps stop some hack attempts
#IF the URI contains a "http:"
RewriteCond %{QUERY_STRING} http\: [OR]
#OR if the URI contains a "["
RewriteCond %{QUERY_STRING} \[ [OR]
#OR if the URI contains a "]"
RewriteCond %{QUERY_STRING} \] [OR]
#OR if the URI contains a "<__script__>"
RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]
#OR script trying to set a PHP GLOBALS variable via URL
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
#OR any script trying to modify a _REQUEST variable via URL
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
RewriteRule ^.*$ - [F,L]
# END Filtering
# CMSMS Rewriting
# Set assume mod_rewrite to true in config.php and clear CMSMS cache
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ index.php?page=$1 [QSA]
# END CMSMS
# END Rewrite rules
Alleen als er een menu gekozen wordt komt er weer /cmsms/naam.html in de url.
Hoe krijg het voor elkaar om ook hier het /cmsms/ te laten verdwijnen ?