如何让这个很长的网址显得很短?

发布于 2024-09-05 00:11:06 字数 231 浏览 12 评论 0原文

我已经使我的大部分网站对 SE 友好,但我的网站的一部分让我烦恼...

我的其中一个页面中有一个巨大的表单,提交表单时 (action=php_page) URL 太长,涵盖了半个单词文档中包含所有传递的变量...

这非常丑陋...

有什么方法可以让这个长 URL 看起来很短吗?

或者您知道其他一些解决方案?

如果您需要更多意见,请告诉我...

谢谢

I have made most my site SE friendly, but one part of my site bugs me...

I have a HUGE form in one of the pages, and when submitting the form (action=php_page) URL is so long it covers half a word document in one line with all the passing variables...

This is very ugly...

Is there any way to make this long URL appear short?

Or some other solution you know of?

Let me know if you need more input...

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

心碎的声音 2024-09-12 00:11:06

使用 POST 而不是 GET 怎么样?

<form action="action.php" method="post">

action.php 中,您必须使用 $_POST 而不是 $_GET

请记住,您应该始终使用 header('success.php');< 重定向到一个在处理表单后显示操作成功的页面(在本例中为 action.php)。 /代码>。如果用户要刷新页面,该操作不会发生两次(如果您要将某些内容写入数据库或类似的内容,这将是不幸的)。

How about using POST instead of GET?

<form action="action.php" method="post">

In action.php you would have to use $_POST instead of $_GET.

Remember that you should always redirect to a page that shows that the action is successful after processing a form (in this case in action.php) using header('success.php');. If the user were to refresh the page, the action won't happen twice (which would be unfortunate if you were to write something to a database or something similar).

毅然前行 2024-09-12 00:11:06

您可以使用 POST 代替 GET,尽管它不能添加书签,对 SEO 不太友好,甚至不如长 URL 友好。如果人们应该能够为其添加书签/将其视为链接,那么您大约有 4 个选择:

  1. 大幅缩短表单。
  2. 如果选择 &复选框,严重缩短它们的名称和发送的实际值(同样,对 SEO 不太友好:Google 等人喜欢 URL 中的关键字)。
  3. 为发布的可能性考虑大量简短的描述,并将这些组合重定向到更短的 URL(如果甚至可以捕获这些组合)。
  4. 忘记表单 URL:它就在那里,人们会使用它。但是,请以机器人可以遵循的方式公开您的爬行内容:也许典型的搜索会变成标签加载,选择框可以变成可爬行的层次结构等。这是为了让人们对您的域感兴趣,然后向他们提供一个表单,如下所示服务以获得精彩内容。

You can use POST instead of a GET, although it wouldn't be bookmarkable, not very SEO friendy, less friendly then a long URL even. If people should be able to bookmark it/ treat it as a link, you have about 4 options:

  1. Shorter the form considerably.
  2. If selects & checkboxes, seriously shorten their names and actual values sent (again,not very SEO friendly: Google et al. like their keywords in the URL).
  3. Think of a lot of shorter descriptions for the possibilities posted, and redirect those combo's to a shorter URL (if it's even possible to capture those combinations).
  4. Forget about the form URL: it's there, people will use it. Do however disclose your content for crawl in a manner a bot can follow: maybe typicial searches become tagcloads, selectboxes can become crawlable hierarchical structures etc. It's about getting people to content they sort of like to your domain, and then offer them a form as service to get to the great content.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文