url-rewriting 相关问题

URL重写引擎是修改Web URL外观(URL重写)的软件。重写的URL用于提供更短和更相关的网页链接,将用户从过时的URL路由到替换,或简化URL的格式以便人类可读。该技术在用于生成网页的文件和呈现给世界的URL之间增加了一定程度的分离。

隐藏azure b2c的url段

是否可以隐藏azure b2c url的url段?我有自定义域,并且被迫使用 Azure Front Door 服务。我看到这个服务有 url 重写功能,所以可以代替这个 url

回答 1 投票 0

Bitnami Apache 重写重写条件和规则

我真的很感谢您在重写某些东西时提供一些帮助。 我已将一个网站移至子域,但现在该网站的链接不起作用。 之前的链接是: https://www.domainname.com/folder/

回答 1 投票 0

IIS 重写 url 中的哈希值(#)

我正在使用 .NET 作为后端和 ReactJS 作为前端框架的应用程序。目前,我们希望从 React Hash Router 迁移到 React Browser Router。改变进展顺利...

回答 1 投票 0

httpContext.Current.Request.RawUrl 用于返回带扩展名的路径

我有一些 ASP.NET C# 代码,可以获取路径名并将其用于各种授权和身份验证任务。在我们的网站项目中,这就是返回路径(带扩展名,用于考试......

回答 1 投票 0

Apache rewrite 重写条件和规则

我真的很感谢您在重写某些东西时提供一些帮助。 我已将一个网站移至子域,但现在该网站的链接不起作用。 之前的链接是: https://www.domainname.com/folder/

回答 1 投票 0

范围 IIS 通过请求 URL 重写出站规则

有没有办法将 IIS 的出站重写规则限制为仅在请求的 URL 与模式匹配时才应用?我怀疑这是不可能的,因为请求 URL 在响应中不可见,但我

回答 1 投票 0

Nginx - 将位置重写为 root (pgadmin4)

我得到了这个 nginx 配置: 服务器 { 听80; 返回 301 https://$host$request_uri; } 服务器 { 听443; server_name my-pgadmin.local; ssl_证书 /etc/ssl/cer...

回答 1 投票 0

当获取没有index.php的目录时,htaccess不会重写URL

我写了一个htaccess文件来重写URL。它应该做什么:当用户访问没有相应 PHP 文件的 URL 时,它会重定向到route.php。 这有点复杂......

回答 1 投票 0

从iis7中的wordpress URL中删除index.php

我想从url中删除index.php,我正在使用wordpress和iis7。 我该怎么做

回答 3 投票 0

Prestashop - .htaccess URL 重写(添加个人链接)

我想知道为什么个人链接(用于 URL 重写)不适用于 Prestashop... 我做了一个测试(添加在文件末尾): RewriteRule ^test$ /index.php [L] 但这不起作用...

回答 4 投票 0

如何使用 IIS 将旧的且不存在的 url 重定向到特定 url

我有网站,我想设置将旧的且不存在的网址重定向到特殊网址 旧网址已不存在 我的配置不起作用! 我有网站,我想设置将旧的且不存在的网址重定向到特殊网址 旧网址已不存在 我的配置不起作用! <rule name="SP" stopProcessing="true"> <match url="^domain.com/Product/PoductDetails/bitouyin/probiotin$" /> <action type="Rewrite" url="domain.com/Products/biotin" /> </rule> 请求旧网址 domain.com/Product/PoductDetails/bitouyin/probiotin 到 domain.com/Product/bitouyin/probiotin 谢谢! 你的重写规则中的参数不正确,你可以尝试这个规则: <rewrite> <rules> <rule name="Remove PoductDetails" stopProcessing="true"> <match url=".*(PoductDetails)(.+)" /> <action type="Redirect" url=domain.com{R:2} appendQueryString="false" /> </rule> </rules> </rewrite>

回答 1 投票 0

Wordpress 搜索页面 URL 中的层次分类术语

我想创建一个在搜索页面中包含友好 URL 的 WordPress 网站。我有一个名为“化妆品”的自定义帖子类型,并且该帖子类型有一个名为“化妆品类型”和“化妆品类型”的自定义分类法...

回答 1 投票 0

IIS 重写规则中的多个条件未被识别

我正在使用 IIS 重写规则来尝试重定向子域 - 例如 来自:www.example.com 至:example.com 或者 来自:this.example.com 至:example.com 规则: 我正在使用 IIS 重写规则来尝试重定向子域 - 例如 来自:www.example.com 致:example.com 或者 来自:this.example.com 致:example.com 规则: <rule name="RedirectAll" enabled="true" stopProcessing="false"> <match url="(.*)" /> <conditions logicalGrouping="MatchAny" trackAllCaptures="false"> <add input="{HTTP_HOST}" pattern="^(www\.)(.*)$" /> <add input="{HTTP_HOST}" pattern="^(this\.)(.*)$" /> </conditions> <action type="Redirect" url="https://{C:2}{REQUEST_URI}" redirectType="Permanent" /> </rule> www重定向有效,但规则的this部分不会触发,因此,如果我转到this.example.com,我最终会得到以下响应: 您的连接不是私人的 攻击者可能试图窃取您的 来自 this.example.com 的信息(例如密码、消息 或信用卡)。了解更多NET::ERR_CERT_COMMON_NAME_INVALID 我并不是在寻求有关该错误的帮助,因为我意识到该错误是因为我没有链接到子域的证书。 即使我更改规则并删除 www 部分,this 条件也不会触发: <rule name="RedirectAll" enabled="true" stopProcessing="false"> <match url="(.*)" /> <conditions logicalGrouping="MatchAny" trackAllCaptures="false"> <add input="{HTTP_HOST}" pattern="^(this\.)(.*)$" /> </conditions> <action type="Redirect" url="https://{C:2}{REQUEST_URI}" redirectType="Permanent" /> </rule> 如果我在 IIS 中测试上述规则 this 它工作正常: 为什么在网站上使用时只有 www 条件有效,而 this 测试不起作用,即使根据屏幕截图测试这两个规则时,两者都工作正常? 一旦该规则包含在 web.config 中并与现有设置一起包含,IIS 是否会忽略除 wwww 规则之外的任何内容? 下面列出了完整的 web.config。 <?xml version="1.0" encoding="UTF-8"?> <configuration> <system.webServer> <httpErrors errorMode="Custom" defaultResponseMode="ExecuteURL"> <remove statusCode="500" subStatusCode="100" /> <remove statusCode="500" subStatusCode="-1" /> <remove statusCode="404" subStatusCode="-1" /> <error statusCode="404" path="/error_404.asp" responseMode="ExecuteURL" /> <error statusCode="500" prefixLanguageFilePath="" path="/error_500.asp" responseMode="ExecuteURL" /> <error statusCode="500" subStatusCode="100" path="/error_500.asp" responseMode="ExecuteURL" /> </httpErrors> <rewrite> <!-- https://blog.elmah.io/web-config-redirects-with-rewrite-rules-https-www-and-more/ --> <rules> <rule name="RedirectToHTTPS" enabled="true" stopProcessing="true"> <match url="(.*)" /> <conditions> <add input="{HTTPS}" pattern="off" ignoreCase="true" /> </conditions> <action type="Redirect" url="https://{SERVER_NAME}/{R:1}" redirectType="Permanent" /> </rule> <rule name="RedirectAll" enabled="true" stopProcessing="false"> <match url="(.*)" /> <conditions logicalGrouping="MatchAny" trackAllCaptures="false"> <add input="{HTTP_HOST}" pattern="^(www\.)(.*)$" /> <add input="{HTTP_HOST}" pattern="^(this\.)(.*)$" /> </conditions> <action type="Redirect" url="https://{C:2}{REQUEST_URI}" redirectType="Permanent" /> </rule> <!-- https://sublimecoding.com/blocking-bots-in-iis/ Added 30th September 2020 --> <rule name="RequestBlockingRule1" enabled="true" stopProcessing="true"> <match url=".*" /> <conditions> <add input="{HTTP_USER_AGENT}" matchType="Pattern" pattern="^$|EasouSpider|Add Catalog|PaperLiBot|Spiceworks|ZumBot|RU_Bot|Wget|Java/1.7.0_25|Slurp|FunWebProducts|80legs|Aboundex|AcoiRobot|Acoon Robot|AhrefsBot|aihit|AlkalineBOT|AnzwersCrawl|Arachnoidea|ArchitextSpider|archive|Autonomy Spider|Baiduspider|BecomeBot|benderthewebrobot|BlackWidow|Bork-edition|Bot mailto:[email protected]|botje|catchbot|changedetection|Charlotte|ChinaClaw|commoncrawl|ConveraCrawler|Covario|crawler|curl|Custo|data mining development project|DigExt|DISCo|discobot|discoveryengine|DOC|DoCoMo|DotBot|Download Demon|Download Ninja|eCatch|EirGrabber|EmailSiphon|EmailWolf|eurobot|Exabot|Express WebPictures|ExtractorPro|EyeNetIE|Ezooms|Fetch|Fetch API|filterdb|findfiles|findlinks|FlashGet|flightdeckreports|FollowSite Bot|Gaisbot|genieBot|GetRight|GetWeb!|gigablast|Gigabot|Go-Ahead-Got-It|Go!Zilla|GrabNet|Grafula|GT::WWW|hailoo|heritrix|HMView|houxou|HTTP::Lite|HTTrack|ia_archiver|IBM EVV|id-search|IDBot|Image Stripper|Image Sucker|Indy Library|InterGET|Internet Ninja|internetmemory|ISC Systems iRc Search 2.1|JetCar|JOC Web Spider|k2spider|larbin|larbin|LeechFTP|libghttp|libwww|libwww-perl|linko|LinkWalker|lwp-trivial|Mass Downloader|metadatalabs|MFC_Tear_Sample|Microsoft URL Control|MIDown tool|Missigua|Missigua Locator|Mister PiX|MJ12bot|MOREnet|MSIECrawler|msnbot|naver|Navroad|NearSite|Net Vampire|NetAnts|NetSpider|NetZIP|NextGenSearchBot|NPBot|Nutch|Octopus|Offline Explorer|Offline Navigator|omni-explorer|PageGrabber|panscient|panscient.com|Papa Foto|pavuk|pcBrowser|PECL::HTTP|PHP/|PHPCrawl|picsearch|pipl|pmoz|PredictYourBabySearchToolbar|RealDownload|Referrer Karma|ReGet|reverseget|rogerbot|ScoutJet|SearchBot|seexie|seoprofiler|Servage Robot|SeznamBot|shopwiki|sindice|sistrix|SiteSnagger|SiteSnagger|smart.apnoti.com|SmartDownload|Snoopy|Sosospider|spbot|suggybot|SuperBot|SuperHTTP|SuperPagesUrlVerifyBot|Surfbot|SurveyBot|SurveyBot|swebot|Synapse|Tagoobot|tAkeOut|Teleport|Teleport Pro|TeleportPro|TweetmemeBot|TwengaBot|twiceler|UbiCrawler|uptimerobot|URI::Fetch|urllib|User-Agent|VoidEYE|VoilaBot|WBSearchBot|Web Image Collector|Web Sucker|WebAuto|WebCopier|WebCopier|WebFetch|WebGo IS|WebLeacher|WebReaper|WebSauger|Website eXtractor|Website Quester|WebStripper|WebStripper|WebWhacker|WebZIP|WebZIP|Wells Search II|WEP Search|Widow|winHTTP|WWWOFFLE|Xaldon WebSpider|Xenu|yacybot|yandex|YandexBot|YandexImages|yBot|YesupBot|YodaoBot|yolinkBot|youdao|Zao|Zealbot|Zeus|ZyBORG|PetalBot|petalbot|aiohttp|Yahoo Ad monitoring" ignoreCase="true" negate="false" /> </conditions> <action type="CustomResponse" statusCode="403" statusReason="Forbidden: Access is denied." statusDescription="You do not have permission to view this directory or page using the credentials that you supplied." /> </rule> </rules> </rewrite> <httpCompression directory="%SystemDrive%\websites\_compressed" minFileSizeForComp="1024" noCompressionForProxies="false" noCompressionForHttp10="false"> <scheme name="gzip" dll="%Windir%\system32\inetsrv\gzip.dll" /> <staticTypes> <add mimeType="text/*" enabled="true" /> <add mimeType="message/*" enabled="true" /> <add mimeType="application/javascript" enabled="true" /> <add mimeType="application/json" enabled="true" /> <add mimeType="image/jpeg" enabled="true" /> <add mimeType="image/gif" enabled="true" /> <add mimeType="image/png" enabled="true" /> <add mimeType="application/javascript" enabled="true" /> <add mimeType="text/css" enabled="true" /> <add mimeType="*/*" enabled="false" /> </staticTypes> </httpCompression> <staticContent> <clientCache cacheControlCustom="public" cacheControlMode="UseMaxAge" cacheControlMaxAge="365.00:00:00" /> </staticContent> <tracing> <traceFailedRequests> <remove path="*" /> </traceFailedRequests> </tracing> <security> <requestFiltering> <filteringRules> <remove name="BlockBots" /> </filteringRules> </requestFiltering> </security> </system.webServer> </configuration> 您看到的错误消息“NET::ERR_CERT_COMMON_NAME_INVALID”表示 SSL 证书存在问题,因为它与您尝试访问的域不匹配。这就是您的规则无法按预期工作的原因。 SSL 证书是针对特定域名(通用名称)颁发的,或者可能包含具有通配符证书的多个子域(例如 *.example.com)。如果您对“example.com”使用常规 SSL 证书,而不是覆盖“this.example.com”的通配符证书,则当您尝试访问“this.example.com”时,SSL 握手将会失败。当然,重定向规则不会继续执行。

回答 1 投票 0

Nginx 将图片网址从子域重定向到 Cloudfront

我需要有关 nginx 重写旧链接的快速帮助。 旧链接:http://widgets.domain.com/person/106400.jpg 新链接:http://xxxxxxx.cloudfront.net/old/widgets/106400.jpg 谢谢!

回答 2 投票 0

.Net Core url 重写的查询字符串问题

在 ASP.NET Core 中开发应用程序时,我在尝试重写单个 url 时遇到问题,例如: https://localhost:44318/Details?content=My-url-to-rewrite&id=221 进入 https://localhost:44318/mypage...

回答 1 投票 0

IIS URL 重写不重写用户友好的 URL

我使用 IIS 向导设置了一个简单的重写规则,应该重写: https://example.com/products/detail/ABC-123 到 https://example/com/products/detail.php?sku=ABC-123 规则是: 我使用 IIS 向导设置了一个简单的重写规则,应该重写: https://example.com/products/detail/ABC-123 到 https://example/com/products/detail.php?sku=ABC-123 规则是: <rule name="RewriteUserFriendlyURL2" stopProcessing="true"> <match url=".*/products/detail/([^/]+)/?$" /> <conditions> </conditions> <action type="Rewrite" url="https://example.com/products/detail.php?sku={R:1}" /> </rule> 当我在 IIS 编辑规则 -> 测试模式对话框中测试友好 URL 时,有一个匹配, R:0 是 https://example.com/products/detail/ABC-123 R:1 是 ABC-123。 然而,当我在浏览器中输入友好的 URL 时,我只是收到 404 错误。不幸的是我看不到它实际输出的重写的网址是什么,有没有办法找出结果? 请尝试以下重写规则: <rewrite> <rules> <rule name="RewriteUserFriendlyURL2"> <match url="^products/detail/([_0-9a-z-]+)" /> <action type="Rewrite" url="products/detail.php?sku={R:1}" /> </rule> </rules> </rewrite>

回答 1 投票 0

如何过滤请求以便apache处理它们而不是tomcat?

由于各种原因,我想在闲置一段时间后关闭我的服务器。我在 Debian 4.9.88 上运行 Tomcat 8.5.29 和 Apache2(不确定版本)。我写了一个脚本来查看...

回答 1 投票 0

使用 Apache mod rewrite 修改查询字符串

我知道可以在我的 htaccess 中使用 mod 重写 拿: http://example.com/directory/perlscript.pl?base64encodedquery=jhfkjdshfsdf78fs8y7sd8 制作一个较短的网址: http://example.com/?什么...

回答 2 投票 0

如何在.htaccess中将“一个文件”从.php mod_rewrite到.html?

mod_rewrite“一个文件”从 .php 到 .htaccess 中的 .html 的语法是什么? 我有所有文件的语法,但如何为一个文件执行此操作?

回答 1 投票 0

重写友好的URL,不同的模式

我有以下重写规则 选项 +FollowSymlinks 重写引擎开启 RewriteRule ^/(.*)/(.*)/(.*)$ /member-profile.php?ID=$2 [L] 我有以下重写规则 <filesMatch "^(member)$"> Options +FollowSymlinks RewriteEngine on RewriteRule ^/(.*)/(.*)/(.*)$ /member-profile.php?ID=$2 [L] </filesMatch> <filesMatch "^(community-events)$"> Options +FollowSymlinks RewriteEngine on RewriteRule ^/(.*)/(.*)/(.*)/(.*)$ /community-events.php?ID=$3 [L] </filesMatch> 这显然是重写这个 mydomain.com/comunity-events/category/id/name 到此 mydomain.com/comunity-events.php?myvariables 现在,我想要一个没有起始“文件夹”的新重定向,就像这样 mydomain.com/business-category/business-name 到 mydomain.com/business-profile.php?variables 在当前配置下,这是否可能,无需为每个类别名称进行重定向? 您甚至不需要 filesMatch 指令,因为您可以匹配 RewriteRule 本身的起始部分。 您可以使用以下规则替换 .htaccess: Options +FollowSymlinks -MultiViews RewriteEngine On # handle /member/... RewriteRule ^/?(member)/(.*)/(.*)$ /member-profile.php?ID=$2 [L,QSA,NC] # handle /community-events/... RewriteRule ^/?(community-events)/(.*)/(.*)/(.*)$ /community-events.php?ID=$3 [L,QSA,NC] # handle /business-category/business-name RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^/?(.*)/(.*)$ business-profile.php?name=$2 [L,QSA]

回答 1 投票 0

© www.soinside.com 2019 - 2024. All rights reserved.