Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search result for infix: / is a 404 #155

Closed
coke opened this issue Oct 12, 2015 · 19 comments
Closed

Search result for infix: / is a 404 #155

coke opened this issue Oct 12, 2015 · 19 comments

Comments

@coke
Copy link
Collaborator

coke commented Oct 12, 2015

It points at http://doc.perl6.org/routine/%2F

@zoffixznet
Copy link
Contributor

Seems there's a whole bunch of them that show up in the results, but result in a 404 when clicked. E.g. .+ (http://doc.perl6.org/routine/.%2B), .? (http://doc.perl6.org/routine/.%3F), .* (http://doc.perl6.org/routine/.*)

@zoffixznet
Copy link
Contributor

The / and // here too: http://doc.perl6.org/routine.html These might require enabling Apache's EncodeSlashes or whatever that option is called.

http://irclog.perlgeek.de/perl6/2015-12-01#i_11635192
http://irclog.perlgeek.de/perl6/2015-12-01#i_11635196

@autarch
Copy link
Contributor

autarch commented Dec 28, 2015

It'd take more than just EncodeSlashes. Some of these may be blocked because of starting with '.'. It might be better to have htmlify.p6 rewrite all symbols into names like 'slash' and 'dot-star', etc.

@zoffixznet
Copy link
Contributor

OK, part of the problem is Apache by default is configured to ignore dotfiles, so that's why all the .whatever operators are 404s.

Since changing IndexIgnore directive alone doesn't fix the entire issue, I think we should seek some alternate solution anyway. Since we can't possibly have a file named '/.html', maybe we should do something like have a base64 encoded filenames that are mapped to from URLs by mod_rewrite + a short decoder script.... just throwing ideas out.

@pdl
Copy link
Contributor

pdl commented Jan 12, 2016

I had a go at trying to work through these locally last month and gave up. There are a lot of these.

  • / is bad because it's the path separator
  • . is bad because of dotfiles, also .. for parent directory; and who knows what else might be going on with file extensions
  • % is bad because of percent-encoding (but works)
  • ? indicates parameters begin
  • & separates parameters
  • = separates keys and values in parameters
  • # indicates the request part is over, the rest is the anchor
  • You also want to be careful with + because it gets percent-encoded; if that ends up in parameters, it may be treated as a space.
  • \ ...actually seems fine

It would be really great to be thinking about SEO at this point, because punctuation-only variables/operators/whatever are a) hard or impossible to google; b) prone to shell-escaping error (perldoc -v $_ on bash) - and @autarch's suggestion would certainly help in this department.

@zoffixznet
Copy link
Contributor

Oh, I seem to have missed @autarch's suggestion to convert symbols to words. Yes, a definite 👍 on that.

@AlexDaniel
Copy link
Member

Yep, way to go.

@AlexDaniel
Copy link
Member

It might be better to have htmlify.p6 rewrite all symbols into names like 'slash' and 'dot-star', etc.

We can borrow these names from this list: http://www.muppetlabs.com/~breadbox/intercal-man/tonsila.html

@stmuk
Copy link
Contributor

stmuk commented Jan 28, 2016

Or just "url encode" then into the % form,

On 28 January 2016 at 04:28, Aleks-Daniel Jakimenko-Aleksejev <
notifications@github.com> wrote:

It might be better to have htmlify.p6 rewrite all symbols into names like
'slash' and 'dot-star', etc.

We can borrow these names from this list:
http://www.muppetlabs.com/~breadbox/intercal-man/tonsila.html


Reply to this email directly or view it on GitHub
#155 (comment).

4096R/EA75174B Steve Mynott steve.mynott@gmail.com

@zoffixznet
Copy link
Contributor

I rather use names, as they're more descriptive and, on a wild guess, would be picked up by eearch engines better. Things like "." still remain "." in percent encoding, so you'd have to add custom rule anyway.

@AlexDaniel
Copy link
Member

I think that @jsoref is making some progress regarding this issue. Contact him if you want to help.

@gfldex
Copy link
Contributor

gfldex commented Jul 11, 2016

here is my list.

$ --> $dollar
/ --> $slash
\ --> $backslash
. --> $dot
% --> $percent
? --> $questionmark
& --> $ampersant
= --> $equal
# --> $hash
+ --> $plus
" --> $quote
' --> $singlequote

We might even use ´'$' ~ $.uniname.subst(' ','')´ ( there is an underscore in the 2nd param) so we only have to keep a list of chars we want to escape and the actual names are generated by Perl 6 for us (what saves time to find typos). I will extend Pod::To::HTML by a callback to filter links as a first step.

@zoffixznet
Copy link
Contributor

It's worth noting teatime was working on the fix for this. I've not seen them on IRC for some time though.

@zoffixznet
Copy link
Contributor

Err, I meant timeless not teatime... 😹

@gfldex
Copy link
Contributor

gfldex commented Jul 11, 2016

: --> $colon # $@({ Windows!

@gfldex
Copy link
Contributor

gfldex commented Jul 12, 2016

~ will not play nice on some webservers and can confuse shells.

@gfldex
Copy link
Contributor

gfldex commented Jul 12, 2016

< and > are also bad on windows

@gfldex
Copy link
Contributor

gfldex commented Jul 13, 2016

all problems know to me seam to be fixed in branch GT#155 https://github.com/perl6/doc/compare/GT%23155

gfldex added a commit that referenced this issue Jul 13, 2016
cure for #155 and windows filename syndrom

- rewrite for / // and $/ are hardcoded in lib/Pod/Htlmify.pm6
- index entry for # and #` are hardcoded in templates/search_template.js

This may break links comming from external sources for funky URLs.
@gfldex
Copy link
Contributor

gfldex commented Jul 13, 2016

fixed with dc0fabb

@gfldex gfldex closed this as completed Jul 13, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants