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
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
bump! anyone...?
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.
any solution to this?
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?
@Stephan: Mal wieder auf ein Bier?
Hi Remo,
thanks for this sweet and simple way to create aliases!
Bierchen immer gern. ;)
Ich schick dir eine Mail.
thanks for this sweet and simple way to create aliases!
Bierchen immer gern. ;)
Ich schick dir eine Mail.