Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #16321 > unrolled thread

Canonical URLs, truncated URLs, redirects and SEO

Started byJames Harris <james.harris.1@gmail.com>
First post2016-01-21 16:39 +0000
Last post2016-01-25 22:20 +0000
Articles 16 — 9 participants

Back to article view | Back to comp.lang.php


Contents

  Canonical URLs, truncated URLs, redirects and SEO James Harris <james.harris.1@gmail.com> - 2016-01-21 16:39 +0000
    Re: Canonical URLs, truncated URLs, redirects and SEO crankypuss <invalid@invalid.invalid> - 2016-01-21 11:22 -0700
      Re: Canonical URLs, truncated URLs, redirects and SEO James Harris <james.harris.1@gmail.com> - 2016-01-22 13:58 +0000
    Re: Canonical URLs, truncated URLs, redirects and SEO Ben Bacarisse <ben.usenet@bsb.me.uk> - 2016-01-21 19:16 +0000
      Re: Canonical URLs, truncated URLs, redirects and SEO James Harris <james.harris.1@gmail.com> - 2016-01-22 14:03 +0000
    Re: Canonical URLs, truncated URLs, redirects and SEO Richard Yates <richard@yatesguitar.com> - 2016-01-21 12:31 -0800
      Re: Canonical URLs, truncated URLs, redirects and SEO Allodoxaphobia <knock_yourself_out@example.net> - 2016-01-21 22:42 +0000
    Re: Canonical URLs, truncated URLs, redirects and SEO Goran <goran@nospam.com> - 2016-01-22 13:01 +0100
      Re: Canonical URLs, truncated URLs, redirects and SEO James Harris <james.harris.1@gmail.com> - 2016-01-22 14:11 +0000
        Re: Canonical URLs, truncated URLs, redirects and SEO Arno Welzel <usenet@arnowelzel.de> - 2016-01-22 17:03 +0100
          Re: Canonical URLs, truncated URLs, redirects and SEO James Harris <james.harris.1@gmail.com> - 2016-01-23 11:59 +0000
            Re: Canonical URLs, truncated URLs, redirects and SEO Ben Bacarisse <ben.usenet@bsb.me.uk> - 2016-01-23 13:09 +0000
              Re: Canonical URLs, truncated URLs, redirects and SEO James Harris <james.harris.1@gmail.com> - 2016-01-23 16:17 +0000
                Re: Canonical URLs, truncated URLs, redirects and SEO "R.Wieser" <address@not.available> - 2016-01-23 20:11 +0100
                  Re: Canonical URLs, truncated URLs, redirects and SEO James Harris <james.harris.1@gmail.com> - 2016-01-24 21:35 +0000
    Re: Canonical URLs, truncated URLs, redirects and SEO Eli the Bearded <*@eli.users.panix.com> - 2016-01-25 22:20 +0000

#16321 — Canonical URLs, truncated URLs, redirects and SEO

FromJames Harris <james.harris.1@gmail.com>
Date2016-01-21 16:39 +0000
SubjectCanonical URLs, truncated URLs, redirects and SEO
Message-ID<n7r1eb$cb1$1@dont-email.me>
Is there a good place to ask about the following? I thought I had 
previously seen some Usenet groups specifically about web development 
but for some reason cannot find any just now.

My query is about having a "normal" URL which could be lengthy, and 
allowing there to be a truncated form. For example, a full/long URL 
could be of the form

 
http://mysite.com/article-1053/what-are-the-main-reasons-why-the-web-might-need-to-have-shorter-forms-for-certain-urls

The shorter, truncated one would be

   http://mysite.com/article-1053

I wanted to ask for some advice on different ways of shortening the URL 
(as the URL form, above, is just one option), about which form would be 
best as canonical, and a related matter about 301 (i.e. permanent) 
redirects to remove the usual "www." prefix.

Any one here aware of a Usenet group that would be good for such queries?

James

[toc] | [next] | [standalone]


#16322

Fromcrankypuss <invalid@invalid.invalid>
Date2016-01-21 11:22 -0700
Message-ID<n7r7fv$6eg$2@dont-email.me>
In reply to#16321
James Harris wrote:

> Is there a good place to ask about the following? I thought I had
> previously seen some Usenet groups specifically about web development
> but for some reason cannot find any just now.
> 
> My query is about having a "normal" URL which could be lengthy, and
> allowing there to be a truncated form. For example, a full/long URL
> could be of the form
> 
>  
> http://mysite.com/article-1053/what-are-the-main-reasons-why-the-web-might-need-to-have-shorter-forms-for-certain-urls
> 
> The shorter, truncated one would be
> 
>    http://mysite.com/article-1053
> 
> I wanted to ask for some advice on different ways of shortening the
> URL (as the URL form, above, is just one option), about which form
> would be best as canonical, and a related matter about 301 (i.e.
> permanent) redirects to remove the usual "www." prefix.
> 
> Any one here aware of a Usenet group that would be good for such
> queries?
> 
> James

Perhaps alt.www.webmaster if it's still active.

Suggestion: Be careful not to invent a security risk in order to save 
the transmission of a few bytes of data.

-- 
http://totally-portable-software.blogspot.com
  [Sun Nov 22: "Total Portability is not binary"]

[toc] | [prev] | [next] | [standalone]


#16327

FromJames Harris <james.harris.1@gmail.com>
Date2016-01-22 13:58 +0000
Message-ID<n7tcdj$4eu$1@dont-email.me>
In reply to#16322
On 21/01/2016 18:22, crankypuss wrote:
> James Harris wrote:

...

>> http://mysite.com/article-1053/what-are-the-main-reasons-why-the-web-might-need-to-have-shorter-forms-for-certain-urls

...

>>     http://mysite.com/article-1053

...

> Perhaps alt.www.webmaster if it's still active.

OK

> Suggestion: Be careful not to invent a security risk in order to save
> the transmission of a few bytes of data.

The URL shortening is not about saving bytes but about allowing short 
URLs to be pasted for human convenience - such as above.

James

[toc] | [prev] | [next] | [standalone]


#16323

FromBen Bacarisse <ben.usenet@bsb.me.uk>
Date2016-01-21 19:16 +0000
Message-ID<87d1suzqsz.fsf@bsb.me.uk>
In reply to#16321
James Harris <james.harris.1@gmail.com> writes:

> Is there a good place to ask about the following? I thought I had
> previously seen some Usenet groups specifically about web development
> but for some reason cannot find any just now.
>
> My query is about having a "normal" URL which could be lengthy, and
> allowing there to be a truncated form. For example, a full/long URL
> could be of the form
>
>
> http://mysite.com/article-1053/what-are-the-main-reasons-why-the-web-might-need-to-have-shorter-forms-for-certain-urls
>
> The shorter, truncated one would be
>
>   http://mysite.com/article-1053
>
> I wanted to ask for some advice on different ways of shortening the
> URL (as the URL form, above, is just one option), about which form
> would be best as canonical, and a related matter about 301
> (i.e. permanent) redirects to remove the usual "www." prefix.
>
> Any one here aware of a Usenet group that would be good for such
> queries?

The best fit is probably comp.infosystems.www.misc though there is not
much traffic.

-- 
Ben.

[toc] | [prev] | [next] | [standalone]


#16328

FromJames Harris <james.harris.1@gmail.com>
Date2016-01-22 14:03 +0000
Message-ID<n7tcmd$4eu$2@dont-email.me>
In reply to#16323
On 21/01/2016 19:16, Ben Bacarisse wrote:
> James Harris <james.harris.1@gmail.com> writes:

...

>> Any one here aware of a Usenet group that would be good for such
>> queries?
>
> The best fit is probably comp.infosystems.www.misc though there is not
> much traffic.

Thanks, that's the area I had seen before. The "infosystems" part is the 
bit I could not remember. It seems superfluous now. With hindsight 
comp.web.* might have been better.

As you say, the misc group seems very quiet. The stylesheets and HTML 
groups seem very active but the rest are quieter.

James

[toc] | [prev] | [next] | [standalone]


#16324

FromRichard Yates <richard@yatesguitar.com>
Date2016-01-21 12:31 -0800
Message-ID<pvf2ablrha4jnpcrboctbnv4t9mcvsqlp0@4ax.com>
In reply to#16321
On Thu, 21 Jan 2016 16:39:12 +0000, James Harris
<james.harris.1@gmail.com> wrote:

>Is there a good place to ask about the following? I thought I had 
>previously seen some Usenet groups specifically about web development 
>but for some reason cannot find any just now.
>
>My query is about having a "normal" URL which could be lengthy, and 
>allowing there to be a truncated form. For example, a full/long URL 
>could be of the form
>
> 
>http://mysite.com/article-1053/what-are-the-main-reasons-why-the-web-might-need-to-have-shorter-forms-for-certain-urls
>
>The shorter, truncated one would be
>
>   http://mysite.com/article-1053
>
>I wanted to ask for some advice on different ways of shortening the URL 
>(as the URL form, above, is just one option), about which form would be 
>best as canonical, and a related matter about 301 (i.e. permanent) 
>redirects to remove the usual "www." prefix.
>
>Any one here aware of a Usenet group that would be good for such queries?
>
>James

I have found the most useful, extensive and responsive help forum to
be http://stackoverflow.com/ 

[toc] | [prev] | [next] | [standalone]


#16325

FromAllodoxaphobia <knock_yourself_out@example.net>
Date2016-01-21 22:42 +0000
Message-ID<slrnna2nlr.1svg.knock_yourself_out@vps.jonz.net>
In reply to#16324
On Thu, 21 Jan 2016 12:31:27 -0800, Richard Yates wrote:
> On Thu, 21 Jan 2016 16:39:12 +0000, James Harris wrote:
>
>>Is there a good place to ask about the following? 

 ... 
> I have found the most useful, extensive and responsive help forum to
> be http://stackoverflow.com/ 

Well now, there's also Web Master World:
	https://www.webmasterworld.com/home.htm

Jonesy

[toc] | [prev] | [next] | [standalone]


#16326

FromGoran <goran@nospam.com>
Date2016-01-22 13:01 +0100
Message-ID<n7t5n3$era$1@news.metronet.hr>
In reply to#16321
On 21.1.2016. 17:39, James Harris wrote:
> Is there a good place to ask about the following? I thought I had
> previously seen some Usenet groups specifically about web development
> but for some reason cannot find any just now.
>
> My query is about having a "normal" URL which could be lengthy, and
> allowing there to be a truncated form. For example, a full/long URL
> could be of the form
>
>
> http://mysite.com/article-1053/what-are-the-main-reasons-why-the-web-might-need-to-have-shorter-forms-for-certain-urls
>
>
> The shorter, truncated one would be
>
>    http://mysite.com/article-1053
>
> I wanted to ask for some advice on different ways of shortening the URL
> (as the URL form, above, is just one option), about which form would be
> best as canonical, and a related matter about 301 (i.e. permanent)
> redirects to remove the usual "www." prefix.
>
> Any one here aware of a Usenet group that would be good for such queries?
>
> James

Why would you support two URLs of the same page? If not, your problem is 
gone. From SEO perspective, prefered version is lengthy one, although I 
would think about shortening it a bit.
Also, first URL path segment is most important, so I suggest you to move 
articleID to the end

[toc] | [prev] | [next] | [standalone]


#16329

FromJames Harris <james.harris.1@gmail.com>
Date2016-01-22 14:11 +0000
Message-ID<n7td5h$7ic$1@dont-email.me>
In reply to#16326
On 22/01/2016 12:01, Goran wrote:
> On 21.1.2016. 17:39, James Harris wrote:

...

>> http://mysite.com/article-1053/what-are-the-main-reasons-why-the-web-might-need-to-have-shorter-forms-for-certain-urls

...

>>    http://mysite.com/article-1053

...

> Why would you support two URLs of the same page? If not, your problem is
> gone.

I've seen a lot of sites have preferred URLs but, conveniently, allow 
them to be shortened. The full URLs are probably there for SEO and 
possibly human purposes. The shorter versions can be handy at times.

> From SEO perspective, prefered version is lengthy one, although I
> would think about shortening it a bit.

I was thinking to make the long URL the canonical one.

> Also, first URL path segment is most important, so I suggest you to move
> articleID to the end

That could be done as long as there was a way programmatically to 
distinguish short and long forms.

James

[toc] | [prev] | [next] | [standalone]


#16330

FromArno Welzel <usenet@arnowelzel.de>
Date2016-01-22 17:03 +0100
Message-ID<56A252EF.1060403@arnowelzel.de>
In reply to#16329
James Harris schrieb am 2016-01-22 um 15:11:

> On 22/01/2016 12:01, Goran wrote:
>> On 21.1.2016. 17:39, James Harris wrote:
> 
> ...
> 
>>> http://mysite.com/article-1053/what-are-the-main-reasons-why-the-web-might-need-to-have-shorter-forms-for-certain-urls
> 
> ...
> 
>>>    http://mysite.com/article-1053
> 
> ...
> 
>> Why would you support two URLs of the same page? If not, your problem is
>> gone.
> 
> I've seen a lot of sites have preferred URLs but, conveniently, allow 
> them to be shortened. The full URLs are probably there for SEO and 
> possibly human purposes. The shorter versions can be handy at times.

Yup:

<http://arnowelzel.de/wp/en/a-week>

Which will redirect to

<http://arnowelzel.de/wp/en/a-week-with-the-pebble>

At least as long as there is no other article which starts with "a-week"
which may be used then.

>> From SEO perspective, prefered version is lengthy one, although I
>> would think about shortening it a bit.
> 
> I was thinking to make the long URL the canonical one.

Yes - because search engines will only use (and show) the canonical one
and the shortened version is sometimes ambiguous and may bring up
something totally different in the future - as in my example, where
"a-week" may now mean "a-week-with-the-pebble" but maybe in a few months
there will be "a-week-in-australia" or whatever was well.



-- 
Arno Welzel
http://arnowelzel.de
http://de-rec-fahrrad.de
http://fahrradzukunft.de

[toc] | [prev] | [next] | [standalone]


#16331

FromJames Harris <james.harris.1@gmail.com>
Date2016-01-23 11:59 +0000
Message-ID<n7vpqq$afk$1@dont-email.me>
In reply to#16330
On 22/01/2016 16:03, Arno Welzel wrote:
> James Harris schrieb am 2016-01-22 um 15:11:

...

>> I've seen a lot of sites have preferred URLs but, conveniently, allow
>> them to be shortened. The full URLs are probably there for SEO and
>> possibly human purposes. The shorter versions can be handy at times.
>
> Yup:
>
> <http://arnowelzel.de/wp/en/a-week>
>
> Which will redirect to
>
> <http://arnowelzel.de/wp/en/a-week-with-the-pebble>
>
> At least as long as there is no other article which starts with "a-week"
> which may be used then.

That is very much the kind of thing I want to do. But I would include a 
unique code, probably a decimal number. For example, the file itself 
could be

   /partition/essay/1053-long-file-name.ext

   "partition" is for a partition of the site.
   "essay" is a sample subfolder name, in this case for essays.
   "1053-" is the unique code indicating which essay was to be served.
   The rest of the name is mainly for human convenience.

Naturally, each such essay would begin with a unique number and a hyphen.

The question is what two URL forms to use in order to get to that file. 
The short URL would basically just need to know the partition, the 
subfolder, and the 1053 code. The canonical URL would also include the 
human-useful text. Canonical URL options for the above file are things like

   http://my-site.com/partition/essay-1053/long-file-name
   http://my-site.com/partition/essay/1053/long-file-name
   http://my-site.com/partition/essay/long-file-name-1053
   http://my-site.com/partition/essay/long-file-name/1053

And the short form could be one of

   http://my-site.com/partition/essay-1053
   http://my-site.com/partition/essay/1053

>>>  From SEO perspective, prefered version is lengthy one, although I
>>> would think about shortening it a bit.
>>
>> I was thinking to make the long URL the canonical one.
>
> Yes - because search engines will only use (and show) the canonical one

OK. That's useful to know.

> and the shortened version is sometimes ambiguous and may bring up
> something totally different in the future - as in my example, where
> "a-week" may now mean "a-week-with-the-pebble" but maybe in a few months
> there will be "a-week-in-australia" or whatever was well.

I am thinking that the only true key would be the decimal number. Even 
for the URL with the long file name I don't see a need to use anything 
other than the number to find the file.

James

[toc] | [prev] | [next] | [standalone]


#16332

FromBen Bacarisse <ben.usenet@bsb.me.uk>
Date2016-01-23 13:09 +0000
Message-ID<87si1o4f32.fsf@bsb.me.uk>
In reply to#16331
James Harris <james.harris.1@gmail.com> writes:
<snip>
> That is very much the kind of thing I want to do. But I would include
> a unique code, probably a decimal number. For example, the file itself
> could be
>
>   /partition/essay/1053-long-file-name.ext
>
>   "partition" is for a partition of the site.
>   "essay" is a sample subfolder name, in this case for essays.
>   "1053-" is the unique code indicating which essay was to be served.
>   The rest of the name is mainly for human convenience.
>
> Naturally, each such essay would begin with a unique number and a hyphen.
>
> The question is what two URL forms to use in order to get to that
> file. The short URL would basically just need to know the partition,
> the subfolder, and the 1053 code. The canonical URL would also include
> the human-useful text. Canonical URL options for the above file are
> things like
>
>   http://my-site.com/partition/essay-1053/long-file-name
>   http://my-site.com/partition/essay/1053/long-file-name
>   http://my-site.com/partition/essay/long-file-name-1053
>   http://my-site.com/partition/essay/long-file-name/1053
>
> And the short form could be one of
>
>   http://my-site.com/partition/essay-1053
>   http://my-site.com/partition/essay/1053
<snip>
> I am thinking that the only true key would be the decimal number. Even
> for the URL with the long file name I don't see a need to use anything
> other than the number to find the file.

Which suggests the short form could be

  http://my-site.com/essay-1053

or even

  http://my-site.com/1053

Not that there's any harm in providing a medium length form as well
since the "partition" and "essay" bits do convey some information to the
reader.

-- 
Ben.

[toc] | [prev] | [next] | [standalone]


#16333

FromJames Harris <james.harris.1@gmail.com>
Date2016-01-23 16:17 +0000
Message-ID<n808tl$1go$1@dont-email.me>
In reply to#16332
On 23/01/2016 13:09, Ben Bacarisse wrote:
> James Harris <james.harris.1@gmail.com> writes:
> <snip>

...

>>    http://my-site.com/partition/essay-1053/long-file-name
>>    http://my-site.com/partition/essay/1053/long-file-name
>>    http://my-site.com/partition/essay/long-file-name-1053
>>    http://my-site.com/partition/essay/long-file-name/1053
>>
>> And the short form could be one of
>>
>>    http://my-site.com/partition/essay-1053
>>    http://my-site.com/partition/essay/1053
> <snip>
>> I am thinking that the only true key would be the decimal number. Even
>> for the URL with the long file name I don't see a need to use anything
>> other than the number to find the file.
>
> Which suggests the short form could be
>
>    http://my-site.com/essay-1053
>
> or even
>
>    http://my-site.com/1053

I couldn't use those shorter forms because the number would only be 
unique within a folder within a partition.

I'd better explain a bit more. The idea is that each partition could be 
under separate control, basically as if it were a separate web site.

The folder which I called "essay" in the example is just the place 
within the partition where the partition's administrator had chosen to 
put a certain web page. In the fictional example, you could imagine that 
there would be an arbitrary number of files that the administrator 
decided to call essays and each essay would have a distinct number. The 
administrator could just as easily have decided to call them "articles" 
or "widgets" or whatever was appropriate, with the folder name 
reflecting that choice.

There could be other folders within the partition, each with its own set 
of files and its own set of rules for URL-to-filename mapping.

As an example of a different type of folder,

   http://my-site.com/partition/ref/scanner

That would lead to

   /partition/ref/scanner.extn

The "ref" folder in this made-up example is intended to be a place where 
terms are defined. (In this case the term is "scanner".) No numeric 
prefix is used - partly because terms are normally short already; no 
special shortening is needed and would, in fact, only get in the way.

Because different folders would have different mapping rules the PHP 
script (this query does therefore just about have a tenuous relationship 
with the subject of the newsgroup!) which converts the URL to a filename 
would need to map differently depending on what folder the URL 
specifies. Continuing the above examples, in "essay" the files would 
have numeric prefixes whereas in "ref" the files would be unnumbered.

That's maybe too much information but it explains why the numeric prefix 
has to apply within a folder, and won't be unique across the entire site.

> Not that there's any harm in providing a medium length form as well
> since the "partition" and "essay" bits do convey some information to the
> reader.

Good point. It's not all about shortening URLs.

James

[toc] | [prev] | [next] | [standalone]


#16334

From"R.Wieser" <address@not.available>
Date2016-01-23 20:11 +0100
Message-ID<56a3cfcd$0$23813$e4fe514c@news.xs4all.nl>
In reply to#16333
James,

Although I'm not fully sure I've understood your problem I do wish to
mention something: As far as I know if a *part* of the specified web path
"lands" on a PHP file than that PHP file will be taken and executed. (I'm
not a 100% sure about if the path needs to include the ".PHP" extension
though ...)

This means that if you have a PHP file named "/partition/ref.php" and your
webserver gets a path like "/partition/ref/scanner" than that above script
would be activated, receiving the full pathname (could be that the remainder
of the path, in your case "/scanner" can be retrieved seperatily too).

This would mean that it becomes quite easy to have seperate PHP scripts
"translate" paths for specific folders.

Hope that helps,
Rudy Wieser
James Harris <james.harris.1@gmail.com> schreef in berichtnieuws
n808tl$1go$1@dont-email.me...
> On 23/01/2016 13:09, Ben Bacarisse wrote:
> > James Harris <james.harris.1@gmail.com> writes:
> > <snip>
>
> ...
>
> >>    http://my-site.com/partition/essay-1053/long-file-name
> >>    http://my-site.com/partition/essay/1053/long-file-name
> >>    http://my-site.com/partition/essay/long-file-name-1053
> >>    http://my-site.com/partition/essay/long-file-name/1053
> >>
> >> And the short form could be one of
> >>
> >>    http://my-site.com/partition/essay-1053
> >>    http://my-site.com/partition/essay/1053
> > <snip>
> >> I am thinking that the only true key would be the decimal number. Even
> >> for the URL with the long file name I don't see a need to use anything
> >> other than the number to find the file.
> >
> > Which suggests the short form could be
> >
> >    http://my-site.com/essay-1053
> >
> > or even
> >
> >    http://my-site.com/1053
>
> I couldn't use those shorter forms because the number would only be
> unique within a folder within a partition.
>
> I'd better explain a bit more. The idea is that each partition could be
> under separate control, basically as if it were a separate web site.
>
> The folder which I called "essay" in the example is just the place
> within the partition where the partition's administrator had chosen to
> put a certain web page. In the fictional example, you could imagine that
> there would be an arbitrary number of files that the administrator
> decided to call essays and each essay would have a distinct number. The
> administrator could just as easily have decided to call them "articles"
> or "widgets" or whatever was appropriate, with the folder name
> reflecting that choice.
>
> There could be other folders within the partition, each with its own set
> of files and its own set of rules for URL-to-filename mapping.
>
> As an example of a different type of folder,
>
>    http://my-site.com/partition/ref/scanner
>
> That would lead to
>
>    /partition/ref/scanner.extn
>
> The "ref" folder in this made-up example is intended to be a place where
> terms are defined. (In this case the term is "scanner".) No numeric
> prefix is used - partly because terms are normally short already; no
> special shortening is needed and would, in fact, only get in the way.
>
> Because different folders would have different mapping rules the PHP
> script (this query does therefore just about have a tenuous relationship
> with the subject of the newsgroup!) which converts the URL to a filename
> would need to map differently depending on what folder the URL
> specifies. Continuing the above examples, in "essay" the files would
> have numeric prefixes whereas in "ref" the files would be unnumbered.
>
> That's maybe too much information but it explains why the numeric prefix
> has to apply within a folder, and won't be unique across the entire site.
>
> > Not that there's any harm in providing a medium length form as well
> > since the "partition" and "essay" bits do convey some information to the
> > reader.
>
> Good point. It's not all about shortening URLs.
>
> James
>

[toc] | [prev] | [next] | [standalone]


#16335

FromJames Harris <james.harris.1@gmail.com>
Date2016-01-24 21:35 +0000
Message-ID<n83ful$5pm$1@dont-email.me>
In reply to#16334
On 23/01/2016 19:11, R.Wieser wrote:
> James,
>
> Although I'm not fully sure I've understood your problem I do wish to
> mention something: As far as I know if a *part* of the specified web path
> "lands" on a PHP file than that PHP file will be taken and executed. (I'm
> not a 100% sure about if the path needs to include the ".PHP" extension
> though ...)
>
> This means that if you have a PHP file named "/partition/ref.php" and your
> webserver gets a path like "/partition/ref/scanner" than that above script
> would be activated, receiving the full pathname (could be that the remainder
> of the path, in your case "/scanner" can be retrieved seperatily too).
>
> This would mean that it becomes quite easy to have seperate PHP scripts
> "translate" paths for specific folders.
>
> Hope that helps,
> Rudy Wieser

Thanks for the tip. I wasn't aware of it.

I think I can avoid the problem you mention because I use URL rewriting 
to direct *all* URLs to a PHP script. At least, that's the intention. I 
have a .htaccess file in the root directory which includes the following.

RewriteEngine On
RewriteBase /
RewriteRule .* utils/microsite.php [END]

AIUI, as long as mod_rewrite or the equivalent is enabled, that will 
cause all Get requests to be intercepted by the PHP script. (I hadn't 
thought about other HTTP methods, though. Something I should check.)

The PHP script is there to

1. validate the URL
2. read a configuration file
3. map the URL to a file name
4. convert the file's content to HTML

The URL rewriting seems to work as intended, at least for Get requests.

James

[toc] | [prev] | [next] | [standalone]


#16336

FromEli the Bearded <*@eli.users.panix.com>
Date2016-01-25 22:20 +0000
Message-ID<eli$1601251704@qz.little-neck.ny.us>
In reply to#16321
In comp.lang.php, James Harris  <james.harris.1@gmail.com> wrote:
> My query is about having a "normal" URL which could be lengthy, and 
> allowing there to be a truncated form. For example, a full/long URL 
> could be of the form
> http://mysite.com/article-1053/what-are-the-main-reasons-why-the-web-might-need-to-have-shorter-forms-for-certain-urls
> 
> The shorter, truncated one would be
> 
>    http://mysite.com/article-1053

I don't think I have something to directly contribute to you question,
but I will note that current conventions typical make long links the
"canonical" form and have terser-than-that short links, sometimes even
in a separate shorter domain.

And when these alternative links exist, the current convention is to
mark them in the headers. Consider a youtube page:

   <link rel="canonical" href="https://www.youtube.com/watch?v=VID_ID">

   <link rel="alternate" media="handheld" href="http://m.youtube.com/watch?v=VID_ID">

   <link rel="alternate" media="only screen and (max-width: 640px)" href="http://m.youtube.com/watch?v=VID_ID">

   <link rel="shortlink" href="https://youtu.be/VID_ID">

   <link rel="alternate" href="android-app://com.google.android.youtube/http/www.youtube.com/watch?v=VID_ID">

   <link rel="alternate" href="ios-app://544007664/vnd.youtube/www.youtube.com/watch?v=VID_ID">

   <link rel="alternate" type="application/json+oembed"
   href="http://www.youtube.com/oembed?url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DVID_ID&amp;format=json"
   title="Video Title">

   <link rel="alternate" type="text/xml+oembed"
   href="http://www.youtube.com/oembed?url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DVID_ID&amp;format=xml"
   title="Video Title">

Most pages don't have nearly that many rel="alternate" links, but the
non "alternate" ones of rel="shortlink" and rel="canonical" are common.
Sites like imgur, which focuses on image sharing, typically also include
a direct link to the important image in the page as rel="image_src".

When preserving "SEO" with multiple URLs, it is likely a good idea to
tell the SE that those URLs exist.

Elijah
------
no longer cares about SEO for himself

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.php


csiph-web