Programmatically create alias

Permalink
I need an alias (NOT a redirect) to be created programatically.

Basically, we have a module where the user creates companies in the admin. When they create a company, i want to make an alias for that company. So say the user creates a company called "Foo". I then want to create an alias so that:

http://www.example.com/Foo
http://www.example.com/Foo/bar

will alias to:

http://www.example.com/Partners
www.www.example.com/Partners/bar...

I don't want the URL to change. IT should still say /foo in it.

Thanks,
Craig

fregas
 
fregas replied on at Permalink Reply
fregas
bump! anyone...?
mkly replied on at Permalink Reply
mkly
fregas replied on at Permalink Reply
fregas
adding aliases in this way seems to make them into redirects. I don't want to redirect. The reason is that when they type inhttp://www.example.com/foo and it goes to the /partners page, i want to look at the URL using PHP and see that "foo" is the partner.
sk01 replied on at Permalink Reply
sk01
any solution to this?
Remo replied on at Permalink Reply
Remo
Old post but this is the first discussion I found when I was looking to create an alias using code. Here's my solution:http://www.codeblog.ch/2013/08/concrete5-programmatically-creating-...

@Stephan: Mal wieder auf ein Bier?
sk01 replied on at Permalink Reply
sk01
Hi Remo,

thanks for this sweet and simple way to create aliases!

Bierchen immer gern. ;)
Ich schick dir eine Mail.