przyjazne URL - pomoc

Pomoc po polsku dla CMS Made Simple
Post Reply
sukos90
Forum Members
Forum Members
Posts: 10
Joined: Mon Dec 27, 2010 12:05 am

przyjazne URL - pomoc

Post by sukos90 »

Witam szukałem i czytałem większość tematów związanych z przyjaznymi url, lecz dalej nie moge tego zrobic.

Obecnie linki wyglądają tak:
a chciałbym żeby wyglądały tak:
Korzystam z wersji cmsms 1.6.9 , robiłem wszystko według instrukcji bez żadnych rezultatów, chciałbym was prosić o szczegóły a nawet gotowy kod z config.php oraz .htaccess tak by to zadziałało. już naprawde sie zgubiłem w tym wszystkim i nie mam już pomysłów jak to zrobić.

Z góry dzieki
User avatar
Marek
Forum Members
Forum Members
Posts: 41
Joined: Sat Nov 01, 2008 11:52 am

Re: przyjazne URL - pomoc

Post by Marek »

Wprowadź na swoją stronę do config.php:

Code: Select all

$config['url_rewriting'] = 'mod_rewrite'; // this is new from 1.6
$config['page_extension'] = '.html';
$config['use_hierarchy'] = true; // no longer in the config file
$config['query_var'] = 'page';
Do pliku .htaccess:

Code: Select all

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

# 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
Opis zmian znajdziesz tutaj:
http://wiki.cmsmadesimple.org/index.php ... l_Settings
Post Reply

Return to “Polish - Polski”