Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
URL's with dots ('.')
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  14 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Sumedh  
View profile  
 More options Dec 3 2008, 6:25 am
From: Sumedh <sumedh.inam...@gmail.com>
Date: Wed, 3 Dec 2008 03:25:23 -0800 (PST)
Local: Wed, Dec 3 2008 6:25 am
Subject: URL's with dots ('.')
Hi Friends,

How is one supposed to handle a URL having a dot ('.')?

For example, http://www.example.com/string.with.dots/file.html

The urlencode() function from PHP doesn't handle dots...and the
routing rules break for these kind of URL's...

So, how should they be taken care of? Is there some standardized way
that everyone uses?

- Thanks in advance,
Sumedh


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Lee Bolding  
View profile  
 More options Dec 3 2008, 7:16 am
From: Lee Bolding <l...@leesbian.net>
Date: Wed, 3 Dec 2008 12:16:15 +0000
Local: Wed, Dec 3 2008 7:16 am
Subject: Re: [symfony-users] URL's with dots ('.')
I've had problems with funny URLs before...

You can solve it a few ways, base64 encoding sometimes works, but that  
sometimes products URLs with /'s in, which also break routing rules.

Look in the PHP manual for 2 way encoding/decoding functions, and  
choose one that works for you...

On 3 Dec 2008, at 11:25, Sumedh wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Sid Bachtiar  
View profile  
 More options Dec 3 2008, 3:46 pm
From: "Sid Bachtiar" <sid.bacht...@gmail.com>
Date: Thu, 4 Dec 2008 09:46:59 +1300
Local: Wed, Dec 3 2008 3:46 pm
Subject: Re: [symfony-users] URL's with dots ('.')
Hi,

I've had problem with this too. I don't know any general solution to
this problem.

For my case, I needed the dot because I was passing email address in
the URL. So I solved it by adding one line (the line with @) in the
web/,htaccess

  # we skip all files with .something
  RewriteCond %{REQUEST_URI} \..+$
  RewriteCond %{REQUEST_URI} !@.+$
  RewriteCond %{REQUEST_URI} !\.html$
  RewriteRule .* - [L]

The one added line in the htaccess basically detect if the URL
contains @ character, if so it will be passed to the controller
instead of handled as a file like images, css, js, etc.

--
Visit my website: http://onlinesid.com

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Gunnar Lium  
View profile  
 More options Dec 3 2008, 4:06 pm
From: "Gunnar Lium" <gunnarl...@gmail.com>
Date: Wed, 3 Dec 2008 22:06:07 +0100
Local: Wed, Dec 3 2008 4:06 pm
Subject: Re: [symfony-users] Re: URL's with dots ('.')

Although not always possible or desirable, you can also get around this
problem by creating urls with ?. For example
somedomain.com/profiles/unsuscribe?email=someem...@anotherdomain.com.
2008/12/3 Sid Bachtiar <sid.bacht...@gmail.com>


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Sumedh  
View profile  
 More options Dec 4 2008, 12:56 am
From: Sumedh <sumedh.inam...@gmail.com>
Date: Wed, 3 Dec 2008 21:56:38 -0800 (PST)
Local: Thurs, Dec 4 2008 12:56 am
Subject: Re: URL's with dots ('.')
Thanks guys....

So Sid, I was thinking this is a problem with symfony routing that it
doesn't handle dots...but the problem actually lies at Apache layer
where it doesn't pass along the parameters correctly to the routing
layer of symfony...right?

If I write rule for
URL - http://www.example.com/string.with.dots/file.html
Rule -
dotted_rule:
  url: /:param1/:fileName

Then value of param1 is not received correctly as "string.with.dots"

If this problem can get solved by the apache rule, as you have said, I
won't need to do any special handling or encoding of the dots... :)

Lee, the URL encoding functions don't handle the dot...I believe it's
primarily because the dot has an important place in URL...just that
it's not taken kindly if it's in between the URL instead of at the
end, (for defining a file extension)...

Gunnar, yeah, as you've said, changing routing structure is a costly
affair, especially when Google (and others) have indexed and
bookmarked your URL's...

On Dec 4, 2:06 am, "Gunnar Lium" <gunnarl...@gmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Sid Bachtiar  
View profile  
 More options Dec 4 2008, 1:16 am
From: "Sid Bachtiar" <sid.bacht...@gmail.com>
Date: Thu, 4 Dec 2008 19:16:30 +1300
Local: Thurs, Dec 4 2008 1:16 am
Subject: Re: [symfony-users] Re: URL's with dots ('.')
The problem is with Symfony's .htaccess. Not in Symfony's controller
nor in Symfony routing. Just in .htaccess.

In a way this is a Symfony 'shortcoming'

> If this problem can get solved by the apache rule, as you have said, I
> won't need to do any special handling or encoding of the dots... :)

You can't really encode the dots (I think), otherwise we won't have
this problem.

--
Visit my website: http://onlinesid.com

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Sumedh  
View profile  
 More options Dec 4 2008, 4:23 am
From: Sumedh <sumedh.inam...@gmail.com>
Date: Thu, 4 Dec 2008 01:23:23 -0800 (PST)
Local: Thurs, Dec 4 2008 4:23 am
Subject: Re: URL's with dots ('.')
Thanks Sid...

Now...I have a URL that is something like - http://www.example.com/string.with.dots/file.html

So, it doesn't contain something like '@' by which I can identify a
URL that is NOT to be skipped...

How do I handle this case? Ideally,

I would want the dots to be handled just like normal characters...what
if just remove the section from Symfony .htaccess that skips URL's
with dots, with exception to .HTML? Will it create a problem for other
kinda files? What's the problem if the request is handed over to
controller in all cases? May be this is a foolish question...but
honestly, it's not very clear to me...

On Dec 4, 11:16 am, "Sid Bachtiar" <sid.bacht...@gmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Sid Bachtiar  
View profile  
 More options Dec 4 2008, 4:31 am
From: "Sid Bachtiar" <sid.bacht...@gmail.com>
Date: Thu, 4 Dec 2008 22:31:51 +1300
Local: Thurs, Dec 4 2008 4:31 am
Subject: Re: [symfony-users] Re: URL's with dots ('.')

> What's the problem if the request is handed over to
> controller in all cases? May be this is a foolish question...but
> honestly, it's not very clear to me...

Well, some URL are not for the controller. for example:
images/something.gif or css/style.css or js/script.js

I think it is better to add a rule that suits your situation than to
try to handle all cases.

Identify a pattern in your URL and add a rule to detect it.

--
Visit my website: http://onlinesid.com

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Fabrice B  
View profile  
 More options Dec 4 2008, 4:57 am
From: Fabrice B <fabrice.bernh...@gmail.com>
Date: Thu, 4 Dec 2008 01:57:25 -0800 (PST)
Local: Thurs, Dec 4 2008 4:57 am
Subject: Re: URL's with dots ('.')
This is a recurrent problem with the default .htaccess or the lighttpd
configuration for symfony

For example, if you want to pass float values as parameters.

The solution lies in customising your rewrite rules in you .htaccess
or lighttpd.conf to better reflect your own configuration. You may
need to plunge a little into regular expressions for that.

Fabrice

On Dec 4, 10:31 am, "Sid Bachtiar" <sid.bacht...@gmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Nicolas Perriault  
View profile  
 More options Dec 4 2008, 5:15 am
From: "Nicolas Perriault" <nperria...@gmail.com>
Date: Thu, 4 Dec 2008 11:15:27 +0100
Local: Thurs, Dec 4 2008 5:15 am
Subject: Re: [symfony-users] Re: URL's with dots ('.')

On Thu, Dec 4, 2008 at 10:57 AM, Fabrice B <fabrice.bernh...@gmail.com> wrote:
> The solution lies in customising your rewrite rules in you .htaccess
> or lighttpd.conf to better reflect your own configuration. You may
> need to plunge a little into regular expressions for that.

I'm using this .htaccess and Apache 2.2 for symfonians.net and it
works smoothly for urls with dots : http://pastie.org/330755

++

--
Nicolas Perriault
http://prendreuncafe.com - http://symfonians.net - http://sensiolabs.com
Phone: +33 660 92 08 67


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Sumedh  
View profile  
 More options Dec 4 2008, 5:29 am
From: Sumedh <sumedh.inam...@gmail.com>
Date: Thu, 4 Dec 2008 02:29:53 -0800 (PST)
Local: Thurs, Dec 4 2008 5:29 am
Subject: Re: URL's with dots ('.')
Okk...Great inputs friends... :)

I think writing this line should suffice for me (along with other 2
default ones) -

  RewriteCond %{REQUEST_URI} !\..*/.*$

What I want to write is "Dont skip the ones with a DOT and then some
content and then a slash and then some content"

So, basically I want the controller to handle "dotted URL's" ;) that
have a slash (/) after the dot somewhere...

On Dec 4, 3:15 pm, "Nicolas Perriault" <nperria...@gmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Sid Bachtiar  
View profile  
 More options Dec 4 2008, 5:38 am
From: "Sid Bachtiar" <sid.bacht...@gmail.com>
Date: Thu, 4 Dec 2008 23:38:32 +1300
Local: Thurs, Dec 4 2008 5:38 am
Subject: Re: [symfony-users] Re: URL's with dots ('.')
Care to collaborate what it does? :)

I tried it and it seems to work nicely

--
Visit my website: http://onlinesid.com

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Eno  
View profile  
 More options Dec 5 2008, 1:59 am
From: Eno <symb...@gmail.com>
Date: Fri, 5 Dec 2008 01:59:05 -0500 (EST)
Local: Fri, Dec 5 2008 1:59 am
Subject: Re: [symfony-users] Re: URL's with dots ('.')

On Thu, 4 Dec 2008, Sid Bachtiar wrote:

> Care to collaborate what it does? :)

> I tried it and it seems to work nicely

The normal htaccess file skips ANY file with a dot in the URL. I think
his version explicitly states which files to ignore using this expression:

        \.(css|js|png|gif|jpg)$

so all other URLs go to the front controller (another rule deals with
.html files, same as the normal htaccess file).


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Sid Bachtiar  
View profile  
 More options Dec 5 2008, 4:35 pm
From: "Sid Bachtiar" <sid.bacht...@gmail.com>
Date: Sat, 6 Dec 2008 10:35:43 +1300
Local: Fri, Dec 5 2008 4:35 pm
Subject: Re: [symfony-users] Re: URL's with dots ('.')
Doh LOL ofcourse

I actually did something like that, a little bit differently. One
thing though, you have to remember to modify the .htaccess if you have
other extensions like jpeg, jpe, swf, flv, mov, mp3, pdf, and so on. I
guess you could add them all there.

--
Blue Horn Ltd - System Development
http://bluehorn.co.nz

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google