$conf, $runtime; function_exists('chdir') AND chdir(APP_PATH); $r = 'mysql' == $conf['cache']['type'] ? website_set('runtime', $runtime) : cache_set('runtime', $runtime); } function runtime_truncate() { global $conf; 'mysql' == $conf['cache']['type'] ? website_set('runtime', '') : cache_delete('runtime'); } register_shutdown_function('runtime_save'); ?>permalinks - Problem with special character WordPress|Programmer puzzle solving
最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

permalinks - Problem with special character WordPress

matteradmin7PV0评论

I have a WordPress and everything seems perfectly fine but I have this page that has title 77% and it shows error 404 page. How can I fix this? I am kind of sure it is because of the % in the 77%. The permalink uses the 77 but for some reason wordpress still doesn't like that % in the title. What can I do to fix this while keeping the % there?

I have a WordPress and everything seems perfectly fine but I have this page that has title 77% and it shows error 404 page. How can I fix this? I am kind of sure it is because of the % in the 77%. The permalink uses the 77 but for some reason wordpress still doesn't like that % in the title. What can I do to fix this while keeping the % there?

Share Improve this question edited Nov 16, 2011 at 2:10 Chris_O 20.6k5 gold badges62 silver badges96 bronze badges asked Nov 15, 2011 at 16:31 grant tailorgrant tailor 1013 bronze badges 3
  • your problem is not the '%', could you show us the code you are using? – andresmijares Commented Nov 15, 2011 at 16:50
  • what do you mean the code i am using? i said i am using wordpress so i don't get what code you want – grant tailor Commented Nov 15, 2011 at 16:56
  • My bad, normally we discuss coding issues in here, so that was my first guess, not from the back-end point of view – andresmijares Commented Nov 15, 2011 at 17:13
Add a comment  | 

2 Answers 2

Reset to default 2

There is nothing you can do, the % symbol is not a neutral character and whatever 2 characters immediatly follow it are used to represent a character. This is called percent encoding.

http://en.wikipedia/wiki/Percent-encoding

For example, to encode a % you would use %25.

Thus the answer is:

No, it is not possible to fix this while keeping the % there, because URLs are percent encoded.

Should by some stroke of luck you manage to get it working, I would recommend still avoiding it due to the misuse of the % symbol

I got this problem too.

First, when I saw it happening, I had to edit the permalink removing the % there. OK.

Second step, I had to search in permalink field in DB, replacing/removing all %. So, just removing it with a replace SQL command.

Third step? Remember to write the title of a new post, save a draft, see the permalink and edit it to remove the % and start write the content of the post.

I tried to see the hard code, and the command responsible to remove special characters and this function is there and the % is also there. So, I can't explain what it happens, but it's not removing it as well.

Post a comment

comment list (0)

  1. No comments so far