"Friendly URL's"

Get help with installation and running phpwcms here. Please do not post bug reports or feature requests here.
brewster66
Posts: 11
Joined: Thu 22. Jun 2006, 20:57

"Friendly URL's"

Post 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
User avatar
TheSearch
Posts: 97
Joined: Thu 22. Dec 2005, 09:56
Location: Lauenau / Willich
Contact:

Post by TheSearch »

if you give the pages an alias it will look like:

root/index.php?name

But you are in the wrong forum :-)
brewster66
Posts: 11
Joined: Thu 22. Jun 2006, 20:57

Post 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)
User avatar
Klappstuhl28
Posts: 833
Joined: Fri 4. Mar 2005, 01:58
Location: Hamburg
Contact:

Post 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.
Lars

Don't say you don't have enough time. You have exactly the same number of hours per day that were given to Helen Keller, Pasteur, Michaelangelo, Mother Teresa, Leonardo da Vinci, Thomas Jefferson, and Albert Einstein. - H. Jackson Brown -
master811
Posts: 8
Joined: Fri 24. Mar 2006, 11:17
Location: UK

Post 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
User avatar
Klappstuhl28
Posts: 833
Joined: Fri 4. Mar 2005, 01:58
Location: Hamburg
Contact:

Post 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
Lars

Don't say you don't have enough time. You have exactly the same number of hours per day that were given to Helen Keller, Pasteur, Michaelangelo, Mother Teresa, Leonardo da Vinci, Thomas Jefferson, and Albert Einstein. - H. Jackson Brown -
User avatar
pico
Posts: 2595
Joined: Wed 28. Jul 2004, 18:04
Location: Frankfurt/M Germany
Contact:

Post 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 ;)
Lieber Gott gib mir Geduld - ABER BEEIL DICH
Horst - find me at Musiker-Board
User avatar
pSouper
Posts: 1552
Joined: Tue 11. Nov 2003, 15:45
Location: London
Contact:

Post 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.
master811
Posts: 8
Joined: Fri 24. Mar 2006, 11:17
Location: UK

Post 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.
zentering
Posts: 120
Joined: Thu 16. Feb 2006, 21:35
Location: Stockholm Sweden

Sub sub categorys doesnt work with rewrite

Post 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?
User avatar
pico
Posts: 2595
Joined: Wed 28. Jul 2004, 18:04
Location: Frankfurt/M Germany
Contact:

Post 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
Lieber Gott gib mir Geduld - ABER BEEIL DICH
Horst - find me at Musiker-Board
zentering
Posts: 120
Joined: Thu 16. Feb 2006, 21:35
Location: Stockholm Sweden

Post by zentering »

:D !!! hehe. It would be verry usefull if it created a alias based on the name of category.



/ Z
User avatar
marcus@localhorst
Posts: 815
Joined: Fri 28. May 2004, 11:31
Location: localhorst
Contact:

Post 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 :-/
User avatar
pico
Posts: 2595
Joined: Wed 28. Jul 2004, 18:04
Location: Frankfurt/M Germany
Contact:

Post 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 :(
Lieber Gott gib mir Geduld - ABER BEEIL DICH
Horst - find me at Musiker-Board
User avatar
marcus@localhorst
Posts: 815
Joined: Fri 28. May 2004, 11:31
Location: localhorst
Contact:

Post 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?
Post Reply