问题标签 [ngx-http-rewrite-module]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
nginx - 从 Joomla 中删除 index.php!带有 NGINX 的 URL
如何index.php
从我的 Joomla URL 中删除?例如:
http://domain.com/index.php/webpage
应该成为
http://domain.com/webpage
我一直在遵循我找到的一些指南,但这都会导致重定向循环、404 或内部服务器错误。我需要一些指导。
这是我当前的配置(不包括失败的尝试)。
redirect - Nginx 重定向/重写 vBulletin URL(带有 slug)到 XenForo
Nginx 重定向/重写规则
如何配置 nginx 进行重定向:
旧网址
- /forum/ - 这是安装 vbulletin 的文件夹
- /elsword-downloads-de-cheats-utilitarios/ - xenforo 中不会出现主题 / 的论坛名称
- 2369461 - 是必须出现在 url xenforo 中的 ID
- -26-04-revolution-trainer-elsword.html - 是访问的主题名称,无论 xenforo 是什么,因为它使用正确的 ID 更正 URL 中的主题名称。
新网址
http://www.webcheats.com.br/threads/26-04-revolution-trainer-elsword.2369461/
- /threads/ - xenforo 在访问这一主题时自动添加地址。
- 26-04-revolution-trainer-elsword - 主题名称,即使 xenforo 系统更正错误
- 2369461 - 最重要的是,主题 ID
另一个例子
旧网址 www.webcheats.com.br/forum/resolvidos/2343690-reposicao-dos-meus-posts.html
新网址 www.webcheats.com.br/threads/reposição-dos-meus-posts.2343690/
旧网址 www.webcheats.com.br/forum/league-of-legends-downloads-de-cheats-utilitarios/2516190-drophack-1-3-funcional-apenas-por-30-dias-aproveite-o-mais- rapido-possivel-veja-ma.html
新网址 www.webcheats.com.br/threads/drophack-1-3-funcional-apenas-por-30-dias-aproveite-o-mais-rapido-possivel-veja-ma.2516190/
if-statement - How to conditionally override a header in nginx only if a cookie exist?
Is there a way to check if a specific cookie exist in nginx
?
For now I have a section like below to set header from cookie:
I want to check if that cookie exist then set the header, otherwise do not override header.
I've tried:
But it does not work and gives the error below:
Any solution?
nginx - 配置 Nginx 以忽略 url 中的路径
我的网站在/root/website/
,里面有一个static
静态文件的文件夹,当用户访问时:/static/dfd99a5/xxx.js
,我希望服务/root/website/static/xxx.js
,我怎么能在 nginx 中做到这一点?
redirect - 使用 nginx 重定向(从 url 中删除子字符串)
我想从旧网址重定向:
到新网址(删除“.html”)
我怎么能用 nginx 做到这一点?
编辑:
xxxxxxxxx
可以不同,例如:
http://example.org/url-1.html
重定向到http://example.org/url-1
http://example.org/another-url.html
重定向to http://example.org/another-url
nginx - Nginx 阻止用户代理“-”
我正在获得某种导致服务器出现问题的访问权限:
我什至想阻止$HTTP_USER_AGENT,做了这个尝试没有奏效。
有人会知道怎么了?
regex - 使用 nginx 从 URI 路径匹配并重定向“http://”(双斜杠)
我希望 nginx 返回 ' http://example.com ' 和请求 url ' http://mydomain/url=http://example.com ' 使用 conf 打击,但它给了我 'http:/xxx.com'。
怎么了,谁能帮忙!谢谢。
这是我的 nginx 配置
redirect - Nginx 301 重定向语法错误
我刚刚发现我的 nginx 语法不正确:
我想将 mysite.com/news 重定向到 mysite.com/blog 但该代码将更多页面重定向到博客。
任何人都可以帮我解释错误并告诉我如何正确重定向?
谢谢
php - Nginx:如何将 URL 子目录重写为查询参数?
我正在尝试在运行 Nginx 的 WordPress 网站中重写 URL,以便将最后一个子目录转换为 GET 参数:
http://mydomain/property/aid/1234/到http://mydomain/property/?aid=1234/
我在 WordPress 中尝试过add_rewrite_rule
,但它没有工作,因为它没有创建新$_GET
条目。
然后我尝试了以下 Nginx 规则:
这似乎根本没有效果。
有什么建议么?