Make WordPress Core

Opened 13 years ago

Closed 12 years ago

#20053 closed defect (bug) (worksforme)

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

Reported by: shopandstore's profile 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)

#1 @scribu
13 years ago

  • Description modified (diff)

#2 follow-up: @scribu
13 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.

#3 in reply to: ↑ 2 ; follow-up: @solarissmoke
13 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.

#4 @scribu
13 years ago

  • Keywords reporter-feedback added

#5 in reply to: ↑ 3 @SergeyBiryukov
13 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.

#6 @shopandstore
13 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.

#7 @dd32
13 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)

#8 @nacin
12 years ago

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