Separate items in the url - url-routing

First, I don't know if this is stupid question but I Will explain to you my problem.
I have a URL, is like this domain/make/model, for example http://www.domain.com/bmw/z3, I would like join the make & model in the url, like http://www.domain.com/bmw:z3/ or http://www.domain.com/bmw#z3/, but I can not use this ":" char because the server thinks is an hack attack, I would like to know, which char you recommend to me to separate items in the URL, I can not use "-", maybe the make and model have this char...
Thanks.

Related

Dynamic URL and Sheet using =Importange

I'm trying to make a =ImportRange with a dynamic URL and Sheet, but I'm doing something wrong.
https://i.stack.imgur.com/QQRDK.png
I've also tryed with ""=Q24"A3:A3") where Q24 = August-September !, but that also give an error.
I want to do the same thing with the URL, but I also get an error when I try to do that.
Is it possible and if, which command do i need to use.
I hope someone could help me.
Br
Anders
use:
=IMPORTRANGE("1HeGmCh3fFgHAfJSIsCIFkFi48PWpXR0iZdBcv4HhSWw"; Q24&"!A3")

Redirect given a certain url

I'm writing a url shortener, I already solve url shortening. Given a certain long URL (LURL), I get a CODE with the help of a script and a database to form a short URL (SURL) of the type:
mysite.com/CODE
So the ralationship between the code and the LURL is stored and must be consulted in the DB. Now as you can see I need a way to do that. My plan is that all the all url in mysite.com direct to the same page where the CODE is taken as a parameter and in this way make a consult in the db fetching the code from the SURL and then redirect with a script to the LURL.
I dont want to generate a SURL that uses a GET request like:
mysite.com/?CODE
It would be easier but I decided not to do it because it defeats the propose of url shorteners by occupying a character unnecessarily.
How would you implement it? Is this method convenient? If you do not think so I would really appreciate you give me your opinion. Maybe there are better ways to do it now that I already have the DB and the shortening algorithm. See you later.
http://www.webcheatsheet.com/PHP/get_current_page_url.php
check out the curPageURL() function.
$pageURL = curPageURL();
$itemArray= explode("/", $pageURL);
$myCode = $itemArray[1];
something like that will do, but not tested. It just gives you an idea of what you can do.
also, to get the url, here is an simplified version: http://phpeasystep.com/phptu/27.html

Encoding url's the Play! Framework

Is there a way to make the Play! Framework ignore slashes and ? in parts of the URL?
Typically, if I have the following:
www.123.com/api/link/http:www.bla.com/?contenId=123&User=test
It won't work. In that case, what I would want to do is simply have the link in the last part of the URL in a String variable to save it. I suppose I can force the client to replace the / and ? by something else, but I would rather keep it simple.
My first thought was that maybe there is a way to configure the routing such that we have something like:
/api/link/{data}
where data would hold whatever remains of the URL. Can't find out how to do that though.
You can't have : / ? except your main URL. You should encode your parameter to append it to main URL. See URLEncoder for Java.
This is not a valid URL:
http://www.123.com/api/link/http://www.bla.com/?contenId=123&User=test
It must be:
http://www.123.com/api/link/http%3a%2f%2fwww.bla.com%2f%3fcontenId%3d123%26User%3dtest
Then you can pass it to {data} parameter and decode it in your handler method.

Reverse Routing Slug-Based URL in CakePHP

(I know there's a couple of other reverse-routing-slugs questions on this site, but I'm not having much luck relating the answers to my particular issue, so I'll ask my more specific question...)
I am building a site whose URLs now need to be slug-based, i.e. what was initially news/item/1 now has to have the URL news/firstnewsitem. And so on for a number of other controllers. I can easily get these addresses to work, and maybe even not stomp on my existing utility actions, with something like:
Router::connect('/:controller/:slug',
array('action'=>'item'),
array('pass'=>array('slug'), 'slug'=>'[^(index|add|edit|view|delete)]')
);
However, the reverse routing of these new links seems to be a non-starter: Cake is still generating such links as news/item/3. It seems optimistic to hope that a slug-based URL would automagically happen, but is there any array that I can pass in my Html->link parameters that will create the :controller/:slug format I'm looking for? Or do I have to cut my losses and back away from reverse routing at this point?
There's a pretty decent plugin for handling slug-based routing here:
https://github.com/jeremyharris/slugger
If you used this, you would be able to create links something like this
$html->link("some item", array(
'controller'=>'items',
'action'=>'view',
'Item'=>$item['id']
));
and that would output a link to /items/view/slug-for-your-item

Pass Query String to rDirectory

Is it possible to pass a query string to Namescape's rDirectory? I'd like to build a web-app that can do a search and display the results in rDirectory, rather than first launching rDirectory and doing said search.
If you are referring to Namescape's rDirectory, the query string would look similar to this:
http://[servername]/?runapp=b05810fe-be2c-4a12-b3a9-858bbb71eff1&AutoSearch=true&cn=alice%20cooper&telephoneNumber=867
the runapp guid is captured from the rDirectory application page in the Designer menu. If you have more questions about this, please contact support#namescape.com
After some digging around and peeking at some rDirectory code, it looks like the query string would look something like this: Results.aspx?CatalogKey=2&FilterExp=x&WhereTxt=x&SortFields=cn. Unfortunately, both "FilterExp" and "WhereTxt" values are passed as encrypted text.
Looks like some time, effort, and perhaps some reverse engineering of the rDirectory web app would be required to get any further.

Resources