[closed-New Topic]Rewriting all URLs to abolute base path

General project discussion. NOT for help questions.
Post Reply
User avatar
CWebguy
Forum Members
Forum Members
Posts: 139
Joined: Thu Jul 24, 2008 3:31 am

[closed-New Topic]Rewriting all URLs to abolute base path

Post by CWebguy »

Ok, I can do this with any site, but I am wondering how you would approach this with CMSMS.

I'm wanting to do a URL structure like
subfolder/123.html
or just
subfolder/123

at the very least I'll settle for
subfolder/pagename

I can do the mod rewrites fine, wondering if I'm going to hack at the core, and where to start!

Thanks.
Last edited by CWebguy on Wed Mar 25, 2009 8:06 pm, edited 1 time in total.
CMSMS Made
RonnyK
Support Guru
Support Guru
Posts: 4962
Joined: Wed Oct 25, 2006 8:29 pm
Location: Raalte, the Netherlands

Re: Rewriting all URLs to abolute base path

Post by RonnyK »

If you mean with subfolder, the parent/child in the menu, then you could do the following.

Copy the htaccess.txt from the /doc folder and put it in the root folder as .htaccess.

Then in the config.php change.
"Assume mod_rewrite"
"Use Hierachy Name"

And put ".html" in
"Page Extension"
Ronny
User avatar
CWebguy
Forum Members
Forum Members
Posts: 139
Joined: Thu Jul 24, 2008 3:31 am

Re: Rewriting all URLs to abolute base path

Post by CWebguy »

But I'm guessing I also need to change something in the core to change what links appear.

I'm going to take a wild guess and say the "menu manager".

Thanks by the way.
CMSMS Made
RonnyK
Support Guru
Support Guru
Posts: 4962
Joined: Wed Oct 25, 2006 8:29 pm
Location: Raalte, the Netherlands

Re: Rewriting all URLs to abolute base path

Post by RonnyK »

With the logic I posted earlier, the links will appear like www.domain.com/parent/child/page.html

What other rewrite are you referring to?

Ronny
User avatar
CWebguy
Forum Members
Forum Members
Posts: 139
Joined: Thu Jul 24, 2008 3:31 am

Re: Rewriting all URLs to abolute base path

Post by CWebguy »

well the parent/child/page.htm is what I have now.

I wanted it to be something like

foldernameichoose/1245    (12345 being the page ID #)

I guess I will need to look at the database to get a bigger understanding of the way everything works.  Maybe write my own menu function.
CMSMS Made
User avatar
CWebguy
Forum Members
Forum Members
Posts: 139
Joined: Thu Jul 24, 2008 3:31 am

Re: Rewriting all URLs to abolute base path

Post by CWebguy »

I guess I'm in for a major overhaul  Be prepared for questions :)
CMSMS Made
RonnyK
Support Guru
Support Guru
Posts: 4962
Joined: Wed Oct 25, 2006 8:29 pm
Location: Raalte, the Netherlands

Re: Rewriting all URLs to abolute base path

Post by RonnyK »

OK, you mean the page-id instead of the alias to be passed to the URL?

What about making the alias then hold the page-id....

Ronny
User avatar
CWebguy
Forum Members
Forum Members
Posts: 139
Joined: Thu Jul 24, 2008 3:31 am

Re: Rewriting all URLs to abolute base path

Post by CWebguy »

Interesting, I would still have to change the {content} to call the page ID instead of the content_name? no?
CMSMS Made
RonnyK
Support Guru
Support Guru
Posts: 4962
Joined: Wed Oct 25, 2006 8:29 pm
Location: Raalte, the Netherlands

Re: Rewriting all URLs to abolute base path

Post by RonnyK »

It would mean, that you make the page_alias, which is set on the options-tab, to hold the id of the page. When you have autofill on in config.php for page-aliasses, it will make the alias, hold the page-name in lowercase, with spaces converted to a -.
You could either go to all the pages, and fill that field to hold the id instead. Or find some logic that does it for you.

Be aware that when modifying the core-sources, that support will be difficult, and that upgrade will become harder as well...

Ronny
User avatar
CWebguy
Forum Members
Forum Members
Posts: 139
Joined: Thu Jul 24, 2008 3:31 am

Re: Rewriting all URLs to abolute base path

Post by CWebguy »

Hey thanks Ronny, I repped you.

Now how about removing the Child Element from each URL?

I have figured that if I just wanted:

example.com/parent/pagename

regardless, even if the current page is a child.

Any ideas?  It doesn't have to be the page ID in the alias for this one.  Maybe I'll start a new thread on this if no responses.

Thanks!
CMSMS Made
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am
Location: Arizona

Re: Rewriting all URLs to abolute base path

Post by Dr.CSS »

Why you going thru all this, if you don't mind my asking?...
User avatar
CWebguy
Forum Members
Forum Members
Posts: 139
Joined: Thu Jul 24, 2008 3:31 am

Re: Rewriting all URLs to abolute base path

Post by CWebguy »

well, there is a site I want to work on, and right now I'm realizing I'm going to get very long URLs, so I'm wanting to cut everything down and keep it neat.  I just want four main categories(parents) that everything is grouped under.  If it's too hard I won't worry about it, but if someone had a solution it would definitly be helpful.

Thanks mark.
Lance
CMSMS Made
viebig

Re: Rewriting all URLs to abolute base path

Post by viebig »

it´s possible and easy but will need core modifications so.. any upggrade of the system would need a modification
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am
Location: Arizona

Re: Rewriting all URLs to abolute base path

Post by Dr.CSS »

It sounds like you just need to make the parent pages and put all your child pages under them, that will give you yoursite.com/parent/child urls and they will be 'clean' if you use mod_rewrite with .htaccess...
Post Reply

Return to “General Discussion”