Problém s pretty URL

Česká/Slovenská podpora pro CMS Made Simple
Post Reply
ripeed
Forum Members
Forum Members
Posts: 19
Joined: Fri Mar 05, 2010 10:54 am

Problém s pretty URL

Post by ripeed »

Zdravím, mám problém s pretty url. Už jsem to několikrát rozchodil ale nyní mi to nejde nebo spíše to není jak bych chtěl.

V url vidím http://www.domena.cz/?page=fotogalerie/

Pokud do url zadám http://www.domena.cz/fotogalerie/
tak se stránka zobrazí taky ale url se zase přehodí na http://www.domena.cz/?page=fotogalerie/

Jak to můžu změnit aby se mi při překlikávání zobrazovalo jen /fotogalerie/?

verze CMS 1.10.3 "Hyacinthe"
Joseph777
Forum Members
Forum Members
Posts: 206
Joined: Wed Mar 16, 2011 9:13 am

Re: Problém s pretty URL

Post by Joseph777 »

pokial budes mat takyto htaccess v roote (CMS je instalovane v roote)

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

# To prevent E_STRICT problems with PHP 5.3+ you can uncomment the following lines
# Note: These settings should only be enabled for production sites!
#php_flag display_startup_errors 0
#php_flag display_errors 0
#php_flag html_errors 0
#php_value docref_root 0
#php_value docref_ext 0

<IfModule mod_rewrite.c>
RewriteEngine on

#option to remove directory listings in all folder (avoid publishing unwanted contents)
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>


# No sense advertising what we are running
ServerSignature Off

# HTTP response header forced to be "Server: Apache" only
# Sometimes this istruction must be saved inside httpd.conf or apache.conf or sites-enabled instead of .htaccess

#
#Sub-dir e.g: /cmsms
RewriteBase /

RewriteCond %{HTTP_HOST} !^www\.domena\.cz [NC]
RewriteRule ^(.*)$ http://www.domena.cz/$1 [L,R=301] 

# 301 Redirect all requests that don't contain a dot or trailing slash to
# include a trailing slash
# but ignore POST requests.
RewriteCond %{REQUEST_URI} !/$
RewriteCond %{REQUEST_URI} !\.
RewriteCond %{REQUEST_METHOD} !POST$
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>

<IfModule mod_header.c>
# Disable ETags
Header unset ETag
FileEtag None
</IfModule>

<IfModule mod_deflate.c>
# Compress css, plaintext, xml, gif, and images in transport.
AddOutputFilterByType DEFLATE text/css text/plain text/xml image/gif image/jpeg image/png
</IfModule>

<IfModule mod_expires.c>
<FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$">
# Set expires tags on various files... so that the browser wont attempt to reload them.
ExpiresActive On
ExpiresDefault "access plus 1 year"
<IfModule mod_header.c>
# Setting cache control to public allowes proxy servers to cache the items too.
Header set Cache-Control "public"
</IfModule>
</FilesMatch>
</IfModule>
a v config.php budes mat okrem ostatneho aj toto tak by to malo fungovat ako má

Code: Select all

$config['url_rewriting'] = 'mod_rewrite';
$config['page_extension'] = '/';
$config['query_var'] = 'page';
ripeed
Forum Members
Forum Members
Posts: 19
Joined: Fri Mar 05, 2010 10:54 am

Re: Problém s pretty URL

Post by ripeed »

Díky, už vím co dělalo ten problém. Je tedy k něčemu toto následující:

Code: Select all

RewriteRule ^index.php http://www.domena.cz/ [R=301,L]
RewriteRule ^index.html http://www.domena.cz/ [R=301,L]
RewriteRule ^index.apsx http://www.domena.cz/ [R=301,L]
RewriteRule ^index.aps http://www.domena.cz/ [R=301,L]
RewriteRule ^index.htm http://www.domena.cz/ [R=301,L]
Post Reply

Return to “Czech/Slovak - Česky/Slovensky”