Page 2 of 5

Re: Pretty URLS

Posted: Wed Jan 13, 2010 10:38 am
by Rolf
Heb je de .htaccess file er wel weer in staan?

Rolf  :)

Re: Pretty URLS

Posted: Wed Jan 13, 2010 2:42 pm
by Rolf
CMS-er

Volgens mij is deze topic nog in de 'oude stijl':
http://forum.cmsmadesimple.org/index.ph ... #msg140890

R.

Re: Pretty URLS

Posted: Tue Jan 19, 2010 10:47 am
by peterv0512
Dag CMS-er,

Wat ik nu ga zeggen klinkt mischien ingewikkeld, maar dat is het he-le-maal niet.
In drie stappen heb je pretty URL's en de nieuwste functionaliteiten.

1. upgraden
-> download/unzip laatste versie
-> maak een backup van je database (laat phpmyadmin direct naar gzip bestand opslaan om gezeik met vreemde tekens te voorkomen)
-> download je eigen bestanden als backup (alle bestanden niet alleen "uploads")
-> laatste versie uploaden naar jouw server (alles overschrijven)
-> surf naar jouwurl.com/admin/upgrade.php en volg de stappen
-> normaal zal alles goed gaan, zo niet zet je je oude bestanden terug en importeer je de oude database

2 .htacces bestand aanpassen
-> maak een tekst bestand aan, noem dit .htacces
Waarschijnlijk gaat je windows pc hier moeilijk over doen, dan noem je het prettyUrls.htacces en hernoem je het na upload
-> in dit bestand staat(let op rewriteBase, dit is de root van je website):

Code: Select all

# No sense advertising what we are running
ServerSignature Off


Options +FollowSymLinks
RewriteEngine on
RewriteBase /

# 301 Redirect all requests that don't contain a dot or trailing slash to
# include a trailing slash
# 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
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+).htm$ index.php?page=$1 [QSA] 
-> upload bestand, indien nodig hernoemen

3. config.php aanpassen

Het stukje onder URL Setting moet er zo uitzien:
(de code in commentaar is natuurlijk niet nodig, maar ik laat het er voor alle duidelijkheid bij staan omdat het ook zo in het bestand staat)

Code: Select all

#------------
#URL Settings
#------------

#What type of URL rewriting should we be using for pretty URLs?  Valid options are:
#'none', 'internal', and 'mod_rewrite'.  'internal' will not work with IIS some CGI
#configurations. 'mod_rewrite' requires proper apache configuration, a valid
#.htaccess file and most likely {metadata} in your page templates.  For more
#information, see:
#http://wiki.cmsmadesimple.org/index.php/FAQ/Installation/Pretty_URLs#Pretty_URL.27s
$config['url_rewriting'] = 'mod_rewrite';

#Extension to use if you're using mod_rewrite for pretty URLs.
$config['page_extension'] = '.htm';

#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)
$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';
Zoals ook in de commentaar staat, zorg bij het aanmaken van je template dat {metadata} erin staat, anders werkt het niet.

En dat is het dan. Ik hoop je hiermee van dienst te zijn geweest.
Mvg,
Peter

Re: Pretty URLS

Posted: Tue Jan 19, 2010 11:05 am
by peterv0512
Dan was ik nog 1 ding vergeten: Als je klaar bent met de upgrade, ga dan in het admin gedeelte naar modules, zoek naar tinyMCE en klik hier op uninstall en klik terug op install (anders werkt dat na upgrade doorgaans niet meer).

Re: Pretty URLS

Posted: Thu Jan 21, 2010 10:03 am
by Gregor
Mijn provider geeft het volgende aan:
Je gebruikt php_flag of php_value in je .htaccess bestanden, dat mag niet.
Dit zijn wel waarden die ik nodig heb om pretty urls werkend te krijgen. Hoe zou ik dit kunnen oplossen?

Gregor

Re: Pretty URLS

Posted: Thu Jan 21, 2010 10:46 am
by Rolf
Gregor wrote: Mijn provider geeft het volgende aan:
Je gebruikt php_flag of php_value in je .htaccess bestanden, dat mag niet.
Dit zijn wel waarden die ik nodig heb om pretty urls werkend te krijgen. Hoe zou ik dit kunnen oplossen?

Gregor
Ohh, maar pretty url gebruikt deze helemaal niet  ???
Standaard staat dit ook niet aan in de meegeleverde htaccess.txt
In deze post staat de werkwijze beschreven:
http://forum.cmsmadesimple.org/index.ph ... 912.0.html

Zet anders hier eens wat informatie neer, dan kunnen we even mee kijken...


@ CMS-er
Is het al gelukt? Alles pretty?  ;)

Grt. Rolf

Re: Pretty URLS

Posted: Thu Jan 21, 2010 11:10 am
by Gregor
Dank je Rolf!

De website draaien op 1 server en daarbinnen zijn de verschillende domeinen uitgezet, dus
www.e-factive.nl
heeft nu pretty url's, maar
www.uisge-beatha.eu
heeft dat niet.

Ik heb maar 1 .htacces en die staat hier:
/home/efacti/public_html/.htaccess
maak ik er een onder uisge-beatha.eu aan, dan krijg ik een error 500

Er zijn 2 confog.php's en een daarvan staat in:
/home/efacti/public_html/uisge-beatha.eu/config.php
overigens beide config-files heb ik aangepast conform instructie

Enig idee??

Gregor

Re: Pretty URLS

Posted: Thu Jan 21, 2010 11:38 am
by Rolf
Dit wil nog wel eens helpen:

Code: Select all

# Options +FollowSymLinks 
Deze regel geeft bij sommige hosts een error 500.
Maar de regel is voor pretty url niet noodzakelijk. # ervoor dus.

Grt. Rolf

Re: Pretty URLS

Posted: Thu Jan 21, 2010 12:34 pm
by Gregor
Een # ervoor geplaatst, .htaccess gekopieerd naar uisge-beatha.eu geen error en ook geen pretty url op www.uisge-beatha.eu ??? Enig idee waar verder te zoeken?

Gregor

Re: Pretty URLS

Posted: Thu Jan 21, 2010 12:47 pm
by peterv0512
Gregor wrote: Er zijn 2 confog.php's en een daarvan staat in:
/home/efacti/public_html/uisge-beatha.eu/config.php
overigens beide config-files heb ik aangepast conform instructie
Dus als ik het goed begrijp staat uisge-beatha.eu in een submap op dezelfde server?
Dan moet je je rewritebase aanpassen. Die is dan niet meer de root (/) maar de juiste map /uisge-beatha.eu/
Dat wordt dan

Code: Select all

RewriteBase /uisge-beatha.eu/

Re: Pretty URLS

Posted: Thu Jan 21, 2010 1:02 pm
by Gregor
Het staat op dezelfde server (ik kan bij Neostrade meerdere domeinen binnen 1 hostingspakket plaatsen).

Als ik de rewritebase .htaccess binnen Uisge-beatha.eu aanpas zoals aangegeven, dan leidt dat niet tot een succes. Op e-factive.nl is pretty url's wel zichtbaar en werkend. De .htaccess van uisge-beatha ziet er als volgt uit:
# .htaccess voor Uisge Beatha
# 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
#
# op aanraden forum cmsms ervoor geplaatst
#Options +FollowSymLinks
#

RewriteEngine on
#
#Sub-dir e.g: /cmsms
RewriteBase /uisge-beatha.eu

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


#
# use images on sub domain
#
# Order deny,allow
# RewriteEngine  on
# RewriteCond %{REQUEST_URI} \.(ico|gif|jpg|jpeg|png|flv|pdf|mp3|wav|js|css|kml|xml)$
# RewriteCond %{HTTP_HOST} ^www\.image\. [NC]
# RewriteRule .* http://www.uisge-beatha.eu/uploads/images%{REQUEST_URI} [R=301,L]

Re: Pretty URLS

Posted: Thu Jan 21, 2010 1:26 pm
by peterv0512
Heb je je config.php bestand al aangepast? In je website zijn de links nog index.php?page=... dus ik denk van niet...

Re: Pretty URLS

Posted: Thu Jan 21, 2010 1:31 pm
by Rolf
De root van de website is uisge-beatha.eu.
Vanaf dit punt staat het cms niet in een submap, je hoeft dan ook geen rewritebase toe te passen, dus:

Code: Select all

#Sub-dir e.g: /cmsms
RewriteBase /
Heb je verder de {metadata} tag in de html sjabloon staan?

De config.php aangepast met mod_rewrite?

Rolf

Re: Pretty URLS

Posted: Thu Jan 21, 2010 1:43 pm
by Gregor
In config.php staat:

Code: Select all

#------------
#URL Settings
#------------

#What type of URL rewriting should we be using for pretty URLs?  Valid options are:
#'none', 'internal', and 'mod_rewrite'.  'internal' will not work with IIS some CGI
#configurations. 'mod_rewrite' requires proper apache configuration, a valid
#.htaccess file and most likely {metadata} in your page templates.  For more
#information, see:
#http://wiki.cmsmadesimple.org/index.php/FAQ/Installation/Pretty_URLs#Pretty_URL.27s
$config['url_rewriting'] = 'mode_rewrite';
#$config['url_rewriting'] = 'none';


#Extension to use if you're using mod_rewrite for pretty URLs.
$config['page_extension'] = '.html';

#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)
$config['use_hierarchy'] = true;
#$config['use_hierarchy'] = false;

#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';
De tag {metadata} staat in de templates. RewriteBase is weer teruggezet naar /

Gregor

Re: Pretty URLS

Posted: Thu Jan 21, 2010 1:52 pm
by Rolf
Gregor wrote: Ik heb maar 1 .htacces en die staat hier:
/home/efacti/public_html/.htaccess
maak ik er een onder uisge-beatha.eu aan, dan krijg ik een error 500
De .htaccess file moet in de root van de website.
Dat is op de plaats waar ook de index.php en config.php van deze website staan.

®olf


PS. Hier dus: /home/efacti/public_html/uisge-beatha.eu/.htaccess