.htaccess - 重定向动态网址

标签 .htaccess seo

最佳答案

我不知道为什么以及你想用这个 url 做什么,但也许你可以得到 url 的第三部分,然后用你的编程语言重定向。

喜欢:

RewriteEngine On
RewriteRule ^travel/([^/]*)/?(.*)$ /index.php?action=$1 [L]

如果你使用 index.php 这会给你 compose-asdf-efgh 然后你可以做任何你想做的事情然后重定向。

一些提示: 在 seo 友好的 url 中使用 - 比使用 _ 更好, 正如这个消息来源所说:http://www.ecreativeim.com/blog/2011/03/seo-basics-hyphen-or-underscore-for-seo-urls/

关于.htaccess - 重定向动态网址,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40153293/

相关文章:

.htaccess 在 SEO 友好的 URL 中提供 404 Not Found

.htaccess url 为 ssl https 重定向重写

web-applications - 使用 REST api SEO 影响的动态元标记绑定(bind)

url - 如何从 cakephp 中的 Controller 操作设置 url?

seo - google rich snippets(评论)显示完全不正确?

php - Wordpress > 更改 x-robots-tag

.htaccess - 如何从 Apache 目录列表中的根文件夹中删除 'Parent Directory' 链接

.htaccess - 重定向不再存在的图片网址

将唯一身份访问者重定向到备用主页?

php - 是否可以通过 PHP 访问 REQUEST_FILENAME?