(SOLVED) abilitazione pretty url

La discussione sul CMS Made Simple in italiano.
Post Reply
giapippo
Forum Members
Forum Members
Posts: 176
Joined: Tue Feb 28, 2012 1:24 pm

(SOLVED) abilitazione pretty url

Post by giapippo »

ciao solito problema con il mod_rewrite

versione 1.10.3
server : servage.net
MySQL Version: MySQL v.5



copiato e rinominato file .htacces nella root
incollato nel file config.php il codice:

$config['url_rewriting'] = 'mod_rewrite';
$config['page_extension'] = '.html';
$config['use_hierarchy'] = true;
$config['query_var'] = 'page';

risultato le url vengno riscrittte ma ricevo se navigo l'errore "page not found"


allego anche il file .htaccess

# 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
#
#Sub-dir e.g: /cmsms
RewriteBase /

# 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




cosa posso fare ??

(premetto che su vecchie versione avevo fatto tutto ed andava)

ciao e grazie in anticipo per l'aiuto
Last edited by giapippo on Mon Mar 12, 2012 6:09 pm, edited 1 time in total.
User avatar
protempore
Power Poster
Power Poster
Posts: 599
Joined: Mon Jan 14, 2008 9:08 pm

Re: abilitazione pretty url

Post by protempore »

giapippo wrote:...
risultato le url vengno riscrittte ma ricevo se navigo l'errore "page not found"
...
sicuro che la root del sito sia "/" e non lo hai magari su una subdirectory?
giapippo
Forum Members
Forum Members
Posts: 176
Joined: Tue Feb 28, 2012 1:24 pm

Re: abilitazione pretty url

Post by giapippo »

ciao innanzi tutto grazie per la risposta

se guardo con filezilla il mio sito e' nella cartella www

allora ho sistemato (per prova) i 2 file cosi:

.htaccess


# 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
#
#Sub-dir e.g: /cmsms
RewriteBase /www

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


e questo e' il config.php

<?php
# CMS Made Simple Configuration File
# Documentation: /doc/CMSMS_config_reference.pdf
#
$config['dbms'] = 'mysql';
$config['db_hostname'] = 'xxxx';
$config['db_username'] = 'xxx';
$config['db_password'] = 'xxx';
$config['db_name'] = 'xxx';
$config['db_prefix'] = 'cms_';
$config['db_port'] = 0;
$config['root_url'] = 'http://www.gianlucacompagno.com';
$config['timezone'] = 'Europe/Rome';
$config['default_encoding'] = 'utf-8';
$config['url_rewriting'] = 'mod_rewrite';
$config['page_extension'] = '';
$config['use_hierarchy'] = true;
$config['query_var'] = 'page';
?>



ho prevato sia con che senza www

ma non cambia niente

help me please :)

ciao a tutti e grazie in anticipo
Last edited by Rolf on Fri Mar 02, 2012 4:15 am, edited 1 time in total.
Reason: removed database config
User avatar
protempore
Power Poster
Power Poster
Posts: 599
Joined: Mon Jan 14, 2008 9:08 pm

Re: abilitazione pretty url

Post by protempore »

a parte di non pubblicare al mondo la chiave d'accesso al tuo DB (ringrazia Rolf ;D ) hai provato a fare un "riordina pagine"?
l'errore "page not found" ce l'hai solo sulle pagine o, ad esempio, nel rewrite degli url delle news?
posti un esempio di url che ti da errore?
giapippo
Forum Members
Forum Members
Posts: 176
Joined: Tue Feb 28, 2012 1:24 pm

Re: abilitazione pretty url

Post by giapippo »

ciao l'errore, a parte la home page, e' su tutte le pagine sia news che non

ho messo il sito visibile, piu' che altro cio che ho scritto come bozza fino ad adesso

ciao grazie mille

p.s. riordina pagine dove lo trovo ?
giapippo
Forum Members
Forum Members
Posts: 176
Joined: Tue Feb 28, 2012 1:24 pm

Re: abilitazione pretty url

Post by giapippo »

dimenticavo

servage, server dove ospito il sito ha questa opzione che posso abilitare o no


You are able to use .htaccess files with your servage account if your required. These Files can be used to influence the webservers configuration on a per-directory level. The most common usage is to configure mod_rewrite, mod_redirect or to create password protected directories that requires user authentication.
Normally we advise you to keep this option turned off as it can affect your website performance negatively or even cause the website to be offline due to misconfigurations in .htaccess files.


.htaccess status: Enabled or Disabled
giapippo
Forum Members
Forum Members
Posts: 176
Joined: Tue Feb 28, 2012 1:24 pm

Re: abilitazione pretty url

Post by giapippo »

risolto!!!

dovevo abilitare sul pannello di controllo di servage la modifica dell file

.htaccess

grazie mille lo per l'aiuto!!
Post Reply

Return to “Italian - Italiano”