Page 1 of 2

"Friendly URL's"

Posted: Sat 24. Jun 2006, 21:05
by brewster66
Is it possible to have a URL instead of this:

/root/index.php?id=0,2,0,0,1,0

More like this:

/root/pages/index.php

Posted: Sat 24. Jun 2006, 21:21
by TheSearch
if you give the pages an alias it will look like:

root/index.php?name

But you are in the wrong forum :-)

Posted: Sat 24. Jun 2006, 21:27
by brewster66
TheSearch wrote:if you give the pages an alias it will look like:

root/index.php?name
I cheked the docu but don't see where alias refers to changing URL's.

(NOTE: This thread is now in the support forum where it should have been)

Posted: Mon 26. Jun 2006, 22:32
by Klappstuhl28
http://www.phpwcms-docu.de/artikel_erstellen.phtml (de)

http://www.phpwcms-docu.de/creating_articles.phtml (en)

It is possible that the article has to be
linked on the page.

Posted: Sat 1. Jul 2006, 03:02
by master811
I am trying to setup a friendly urls but they don't seem to be working. Is there anything that needs to be done.

I have an article, for instance called "news", but the link "www.mysite.com/index.php?news" doesn't seem to do anyting, it just takes me to to the default start page (i.e. index.php).

Am I just being stupid, or is something wrong?

Thanks

Posted: Sat 1. Jul 2006, 10:44
by Klappstuhl28
category and article set "public" and "visible"?
So that you get a green eye and also a green "V" and "P"

http://www.phpwcms-docu.de/creating_articles.phtml
http://www.phpwcms-docu.de/article.phtml

Posted: Sat 1. Jul 2006, 11:24
by pico
Hi

the Alias is not taken from the Article it is taken from the Alias of the Structure-Level
goto Admin->Sitestructure-> Sub-Level
and give something into 'ALIAS'-Field - save and look what happens at Frontend ;)

Posted: Sat 1. Jul 2006, 13:40
by pSouper
hi brewster66,
I think you are after somthing closer the 'modrewrite' this is were apche re-writes the url to a more reader friendly one.
you should search for help within this forum on modrewrite.
in short though...

within config.inc.php set the following line to = 1

Code: Select all

$phpwcms["rewrite_url"]       = 0;        //whether URL should be rewritable
then rename the file _.htaccess to .htaccess and edit this file in notepad of simmilar to include the following (removing the # on the line you wish to include and prefixing the line you do not wish to include with a #)....

Code: Select all

# Rewrite functionality for phpwcms
# optimized by Jan212
# 18-04-2004

# Check that you have set Options FollowSymLinks
# and right Allow
RewriteEngine On

# maybe you need this
DirectoryIndex index.htm index.html index.php 


# Default ReWrite settings for phpwcms
# ===============================================
# This will rewrite 0.0.0.0.0.0.phtml => index.php?id=0.0.0.0.0.0
RewriteRule ^([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)\.phtml$ index.php?id=$1,$2,$3,$4,$5,$6

# This will rewrite mypage.phtml => index.php?mypage
RewriteRule ^(.+)\.phtml$ index.php?$1


# If phpwcms is installed in a subdirectory,
# sample: "mysubdir" then use this (remove #)
# if above lines doesn't work for you
# ===============================================
#RewriteBase /mysubdir
#RewriteRule ^([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)\.phtml$ /mysubdir/index.php?id=$1,$2,$3,$4,$5,$6
#RewriteRule ^(.+)\.phtml$ /mysubdir/index.php?$1 


# If you want to set rewrite logging
# ===============================================
#RewriteLog "/absolute/path/to/the/rewrite.log" 
# 0 = Logging disabled, 9 = highest level of logging, only for debugging 
#RewriteLogLevel 3
now the name of your webpages will reflect that of the 'category alias' set within each catergory witihn the admin area (as mentioned in previous posts)

e.g. http://www.polygonsoup.net/portfolio.phtml
any pages without an alias with have the id number as the page name.

e.g http://www.polygonsoup.net/88.0.0.1.0.0.phtml

hope it helps.

Posted: Sat 1. Jul 2006, 16:42
by master811
Well it still doesn't work for me I know mod_rewrite is turned on on the server, but I don't know what I'm doing wrong, I've made sure its correct in the config file (I think) though not too sure about the .htaccess file - but I think that is correct as well.

I've now realised though that the site isn't actually viewable unless you are logged in - but everything seems to be green in the article menus, so I can't even show you my problem.

Sub sub categorys doesnt work with rewrite

Posted: Tue 11. Jul 2006, 22:31
by zentering
Hi, i have a little prob with rewrite,

on this level it works fine

http://www.domain.eu/site/sendstudio.phtml


but when going deeper in the structure it returns me to the index page:

http://www.domain.eu/site/33,0,0,1,0,0.phtml
(is http://www.mywebagent.eu/site )

Any suggestion?

Regards / Z




Fixed it, i forgot to put a alias on the sub sub categorys.
As i now understand if there is no alias it doesnt work?

Posted: Wed 12. Jul 2006, 08:20
by pico
Hi

you're right, if there is no Alias then no rewrite can do - it's easy to understand No Alias -> nothing to 'rewrite' or should phpwcms generate a 'Random' Alias ;)

I will compare it with a Telefonnumber - if you don't have a Entry in the Phonebook, just the Number, you can dial the Number, but you don't know the Name. So Rewrite just 'looks' to the Phonebook-Name (Alias) and 'dials' the correct Number :D

Posted: Wed 12. Jul 2006, 10:27
by zentering
:D !!! hehe. It would be verry usefull if it created a alias based on the name of category.



/ Z

Posted: Wed 12. Jul 2006, 10:59
by marcus@localhorst
hello,
take a look to this last post:
http://www.phpwcms.de/forum/viewtopic.p ... ht=rewrite
it's possible and you can see a working example here:
http:/-/www.autorenhaus-verlag.de/88.150.0.0.1. ... chen.phtml
just add the article headline to the url to make it human readable.

the only problem I've noticed (with or without this hack), phpwcms render urls in different ways. somtimes it uses the alias.phtml sometimes it uses the id.phtml (for artikles, which have alias) with my solution, there are somtimes 3 different urls with the same conten :-/

Posted: Wed 12. Jul 2006, 11:47
by pico
Hi

maybe I'm wrong, but I think that nobody will remember a Link like this
shure it is more 'readable' as index.php?12.23.34.00 or however it looks.
For me the URL of a Site is what I remember and then there have to be a good Navigation - so I can find the Information what I'm looking for.
And the URL must have a relation to the Content - http://www.cars.tld with Content about Printers makes no sense :(

Posted: Wed 12. Jul 2006, 12:12
by marcus@localhorst
yes, ok, real aliases/short urls are better than my version (it's just to read statistics more easily and the customer think it#s better for searchengines)

i realize the aliases via .htacces 301 redirect to the real phpwcms site
Redirect 301 http://mysite.de/alias http://mysite.de/41.36.0.0.1.0.phtml

maybe it is possible, to write the htaccess automatically?