• twitter image
  • facebook image
  • youtube image
  • linkedin image
Language: CMS Made Simple Czech CMS Made Simple France CMS Made Simple Hungary CMS Made Simple Russia CMS Made Simple Netherlands

All times are UTC




Post new topic Reply to topic  [ 38 posts ]  Go to page 1, 2, 3  Next
Author Message
 Post subject: Pekna URL
PostPosted: Mon Jan 12, 2009 10:09 pm 
Offline
Forum Members
Forum Members
User avatar

Joined: Thu Aug 16, 2007 8:08 am
Posts: 137
Location: Prague, Czech Republic
jiz nekolikrat se mi lide ptali na pekna URL, tak tady male howto

config.php - nalezt a upravit si podle sveho na www.cmsmadesimple.cz je toto nasledujici
Code:
#------------
#URL Settings
#------------

#Show mod_rewrite URLs in the menu? You must enable 'use_hierarchy' for this to work for modules
#ze se ma prepisovani url zapnou
$config['assume_mod_rewrite'] = true;

#Extension to use if you're using mod_rewrite for pretty URLs.
#co ma byt za priponu stranky(sklada se to aliaspripona - takze napr kontakty/ , kdyby pripona byla .html, tak by to vypadalo kontakty.html)
$config['page_extension'] = '/';

#If you don't use mod_rewrite, then would you like to use the built-in
#pretty url mechanism?  This will not work with IIS and the {metadata} tag
#should be in all of your templates before enabling.
$config['internal_pretty_urls'] = true;

#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)
#zda se ma pouzivat hierarchie (http://www.mysite.com/rodic/rodic/stranka)
$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';


a pak jeste vytvorit/upravit .htaccess(pro apache-jine servery samozrejme jinak)
Code:
Options +FollowSymLinks
RewriteEngine on
RewriteBase /

# 301 Redirect all requests that don't contain a dot or trailing slash to
# include a trailing slash
# protoze pouzivam priponu /, tak chci aby vse takovou priponu melo.
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
#toto je aktualni rewrite z nice url(http://www.mysite.com/rodic/rodic/stranka/), aby se to zoobrazilo
RewriteCond %{REQUEST_FILENAME} !-f [NC]
RewriteCond %{REQUEST_FILENAME} !-d [NC]
RewriteRule ^(.+)$ index.php?page=$1 [QSA]

lepsi pochopeni viz. preklady u komentaru


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: Pekna URL
PostPosted: Thu Jan 29, 2009 12:12 pm 
Offline
Forum Members
Forum Members

Joined: Thu Dec 11, 2008 11:29 am
Posts: 12
Ahoj, potřeboval bych poradit s rewrite. Použil jsem uvedené .htaccess, ale server mi házel chybu 500, aby mi to fungovalo musel jsem smáznout Options +FollowSymLinks. Adresy fungují, ale přestaly se mi zobrazovat ikony ve správci obrázků v administraci. Nevíte kde bych mohl hledat problém? Webhosting mám na savana.cz

Mám verzi CMS 1.5.1

Díky


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: Pekna URL
PostPosted: Wed Feb 11, 2009 8:29 pm 
Offline
Forum Members
Forum Members
User avatar

Joined: Fri Jan 02, 2009 2:22 pm
Posts: 82
Location: Prague, Jilemnice, Czech republic
go2web wrote:
Ahoj, potřeboval bych poradit s rewrite. Použil jsem uvedené .htaccess, ale server mi házel chybu 500, aby mi to fungovalo musel jsem smáznout Options +FollowSymLinks. Adresy fungují, ale přestaly se mi zobrazovat ikony ve správci obrázků v administraci. Nevíte kde bych mohl hledat problém? Webhosting mám na savana.cz

Mám verzi CMS 1.5.1

Díky


A vedou adresy obrázku správně na jejich fyzické umístění? Ta 500ka může znamenat že se to tluče s jiným .htaccess.

_________________
Nothing is true, everything is permitted.


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: Pekna URL
PostPosted: Mon Mar 09, 2009 9:30 am 
Offline
Forum Members
Forum Members

Joined: Thu Dec 11, 2008 11:29 am
Posts: 12
Jo vedou určitě správně, když rewrite vypnu zase vše funguje. Jestli se to tluče s jiným .htaccess, dá se s tím něco dělat?


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: Pekna URL
PostPosted: Mon May 18, 2009 12:07 pm 
Zdravim vsechny, mate nekdo zkusenosti ze stable.cz, udelal jsem vse dle navodu tady a narazil jsem na problem, ze kdyz nasledne kliknu na dany odkaz tak mi to nahlasi Error 404.. Muzete mi prosim nekdo poradit? Uz nevim jak dal ..

Diky,
A.


Top
   
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: Pekna URL
PostPosted: Tue May 19, 2009 11:22 am 
Offline
Forum Members
Forum Members
User avatar

Joined: Thu Aug 16, 2007 8:08 am
Posts: 137
Location: Prague, Czech Republic
valdner wrote:
... kliknu na dany odkaz tak mi to nahlasi Error 404...


pravdepodobne hosting nepodporuje mod_rewrite


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: Pekna URL
PostPosted: Sat May 23, 2009 10:46 am 
Offline
New Member
New Member

Joined: Sat May 23, 2009 10:43 am
Posts: 3
valdner wrote:
Zdravim vsechny, mate nekdo zkusenosti ze stable.cz, udelal jsem vse dle navodu tady a narazil jsem na problem, ze kdyz nasledne kliknu na dany odkaz tak mi to nahlasi Error 404.. Muzete mi prosim nekdo poradit? Uz nevim jak dal ..

Diky,
A.


404 znamena ze stranka neexistuje tim ze si aktivoval mod_rewrite a zacal prepisovat url na "hezky tvar" se zakonite zmenila url.


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: Pekna URL
PostPosted: Sat May 23, 2009 8:25 pm 
Offline
Forum Members
Forum Members
User avatar

Joined: Thu Aug 16, 2007 8:08 am
Posts: 137
Location: Prague, Czech Republic
michaljirku wrote:
404 znamena ze stranka neexistuje tim ze si aktivoval mod_rewrite a zacal prepisovat url na "hezky tvar" se zakonite zmenila url.


pokud zmenil nastaveni presne podle navadu, tak se zmenili odkazy i v menu atd. takze sice se zmenili odkazy, ale take se zmenili odkazy v menu, na ktere predpokladam, ze klika. Takze pokud udelal presne to co je v navodu, tak to proste mod_rewrite nepodporuje hosting


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: Pekna URL
PostPosted: Mon May 25, 2009 6:38 pm 
Offline
New Member
New Member

Joined: Sat May 23, 2009 10:43 am
Posts: 3
kino wrote:
michaljirku wrote:
404 znamena ze stranka neexistuje tim ze si aktivoval mod_rewrite a zacal prepisovat url na "hezky tvar" se zakonite zmenila url.


pokud zmenil nastaveni presne podle navadu, tak se zmenili odkazy i v menu atd. takze sice se zmenili odkazy, ale take se zmenili odkazy v menu, na ktere predpokladam, ze klika. Takze pokud udelal presne to co je v navodu, tak to proste mod_rewrite nepodporuje hosting



Ve vetsine pripadu kdyz hosting nepodporuje mod_rewrite vyhlasi to chybu 500 Internal Server Error ne 4O4 page


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: Pekna URL
PostPosted: Fri Oct 30, 2009 6:08 pm 
Offline
New Member
New Member
User avatar

Joined: Thu Mar 05, 2009 10:40 am
Posts: 6
Location: Czech Republic, sometimes Greece
Mě to též hází error 404, ačkoli hosting by měl mod_rewrite podporovat. Kompromisním řešením bylo nastavit

Code:
$config['url_rewriting'] = 'internal';


což funguje, ale URL se zobrazují jako "site/index.php/parent/child.htm" a toho "index.php" se ne a ne zbavit. Nicméně to je spíš kosmetická vada.

_________________
Tux mihi ancora.


Last edited by Anonymous on Mon Nov 02, 2009 6:45 pm, edited 1 time in total.

Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: Pekna URL
PostPosted: Wed Apr 07, 2010 1:47 pm 
Offline
Forum Members
Forum Members

Joined: Mon Sep 10, 2007 1:58 pm
Posts: 75
Location: Pardubice
Nemate prosim nekdo potuchu jak to nastavit na IIS? Dik moc za kazdy tip.


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: Pekna URL
PostPosted: Tue Apr 20, 2010 6:15 am 
Offline
Forum Members
Forum Members

Joined: Wed Jan 06, 2010 12:51 pm
Posts: 29
Prosím o radu, upravený htaccess i config mám, jenže pořád se zobrazuje URL ve tvaru např.
http://vzor.itrinec.cz/index.php?page=diskuze a ne http://vzor.itrinec.cz/diskuze , když ale tuto URL napíši ručně , tak je stránka s hezkou URL funkční.  ??? Zase a opět něco nechápu.


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: Pekna URL
PostPosted: Thu Apr 22, 2010 9:46 am 
Offline
Forum Members
Forum Members
User avatar

Joined: Thu Aug 16, 2007 8:08 am
Posts: 137
Location: Prague, Czech Republic
2zmija:
v config.php misto interal pouzij
$config['url_rewriting'] = 'mod_rewrite';

a melo by to fungovat.


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: Pekna URL
PostPosted: Thu Apr 22, 2010 6:44 pm 
Offline
Forum Members
Forum Members

Joined: Wed Jan 06, 2010 12:51 pm
Posts: 29
Kino díky, šlape!!!  ;D  ;D  ;D


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: Pekna URL
PostPosted: Tue Apr 27, 2010 1:40 pm 
Offline
New Member
New Member

Joined: Mon Jan 19, 2009 12:27 pm
Posts: 4
Mám stejný problém se zobrazováním index.php uvnitř adresy stránky

Ektos.Elenchu wrote:
Mě to též hází error 404, ačkoli hosting by měl mod_rewrite podporovat. Kompromisním řešením bylo nastavit

Code:
$config['url_rewriting'] = 'internal';


což funguje, ale URL se zobrazují jako "site/index.php/parent/child.htm" a toho "index.php" se ne a ne zbavit. Nicméně to je spíš kosmetická vada.


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 38 posts ]  Go to page 1, 2, 3  Next

All times are UTC


Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
A2 Hosting