WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 3 years ago

#20053 closed defect (bug) (worksforme)

Slug is case-sensitive for pages, but not for posts

Reported by: shopandstore Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.3.1
Component: Canonical Keywords: reporter-feedback close
Focuses: Cc:

Description (last modified by scribu)

hello,

if i have a page(not post) on my site (named "WORD"),
i want the function to understand that value.

i use

$var = word; ///not a double quotation;
$var = strtoupper($var);
$_GET['page_id']=$var;

but it doesn't work. if my site has a page "word" (with lowercase), than the function works. but i want

to get the uppercase value. i need this..

strtoupper(word); gives you = WORD,
but the whole function, which has
$_GET['page_id']=strtoupper(word);

can't find the page named mysite.com/WORD, but it searches again for the page mystie.com/word" (with lowercase).

everything works well for posts, but i want for pages..

Change History (8)

comment:1 @scribu4 years ago

  • Description modified (diff)

comment:2 follow-up: @scribu4 years ago

  • Component changed from Charset to Canonical
  • Summary changed from Problem with Pages (not posts) to Slug is case-sensitive for pages, but not for posts

So, what you're saying is that for posts, the slug is case-insensitive, but it's not for pages.

comment:3 in reply to: ↑ 2 ; follow-up: @solarissmoke4 years ago

So, what you're saying is that for posts, the slug is case-insensitive, but it's not for pages.

It's case-insensitive everywhere for me. Visiting /wp/PAGESLUG and /wp/pageslug gives me the same thing.

comment:4 @scribu4 years ago

  • Keywords reporter-feedback added

comment:5 in reply to: ↑ 3 @SergeyBiryukov4 years ago

Replying to solarissmoke:

It's case-insensitive everywhere for me. Visiting /wp/PAGESLUG and /wp/pageslug gives me the same thing.

Same for me. I don't quite get the code samples here. page_id is supposed to be a number, not a word.

comment:6 @shopandstore4 years ago

Well, for you it's may be of no mean, but i use UPPER chars in the page parmalinks,so i don't want to redirect from
/wp/PAGESLUG to /wp/pageslug, because i have different content on each page.

comment:7 @dd324 years ago

  • Keywords close added

but i use UPPER chars in the page parmalinks,so i don't want to redirect from /wp/PAGESLUG to /wp/pageslug, because i have different content on each page.

WordPress doesn't allow you to make uppercase page slugs, as a result, you'll never have the url /wp/PAGESLUG/. Due to the case-insensitivities of certain parts of the storage system, You can't have a slug PAGESLUG and a pageslug either.

I do note that Canonical doesn't seem to redirect on uppercase url's though (for pages at least)

comment:8 @nacin3 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to worksforme
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.