从Excel中的URL中删除域

时间:2022-08-23 10:41:48

I'm dissecting urls for SEO purposes and I'm searched all forums for a formula that can remove the domain from a url, but can't seem to find the formula that returns favorable results. This is what I want to do:

为了搜索引擎优化的目的,我正在剖析url,我在所有的论坛上搜索一个公式,这个公式可以从url中删除域,但似乎找不到返回良好结果的公式。这就是我想做的:

https://www.walsallhealthcare.nhs.uk/contact-us/useful-links/subject-categories.aspx

https://www.walsallhealthcare.nhs.uk/contact-us/useful-links/subject-categories.aspx

--> contact-us/useful-links/subject-categories.aspx

- - >联系我们/有用链接/ subject-categories.aspx

I'm using this formula in Excel to remove domain. However this doesn't work for secured sites, and I always have to replace "8" with "9" to make it work. Is there any way to make this work for both http and https websites?

我在Excel中使用这个公式来删除域。然而,这对于安全站点来说并不适用,我总是需要用“9”来代替“8”来实现它。有什么方法可以让http和https网站同时运行?

=MID(A1,FIND("/",A1,8),LEN(A1)+1-FIND("/",A1,8))

=中期(A1,找到(“/”,A1,8),LEN(A1)+找出(" / " A1 8))

Also, I want to remove the "/" at the beginning. Is this possible?

另外,我想在开始时删除“/”。这是可能的吗?

Thank you so much!

谢谢你这么多!

4 个解决方案

#1


4  

I tried this with the http and https versions of your URL (where A3 has your URL); seems to work.

我在您的URL的http和https版本中尝试过(其中A3有您的URL);似乎工作。

=RIGHT(A3,LEN(A3)-FIND("/",A3,FIND("//",A3)+2))

#2


0  

If you are creating 301 rules, adding a "+1" will make sure the "/" is included in the beginning of the path :

如果您正在创建301条规则,添加“+1”将确保“/”包含在路径的开头:

=RIGHT(A3,LEN(A3)-FIND("/",A3,FIND("//",A3)+2)+1)

=正确(A3,LEN(A3)找到(“/”,A3,发现(“/ /”,A3)+ 2)+ 1)

#3


0  

Is it mandatory to be in excel? You can use google sheets and this simple function will autoextract exactly what you need:

是否必须使用excel?您可以使用谷歌表,这个简单的函数将自动提取您需要的内容:

=REGEXEXTRACT(A1,".*\.\w+\/(.*\/*?)")

#4


0  

=RIGHT(LEFT(A3;FIND("/";A3;FIND("//";A3)+2)-1);LEN(LEFT(A3;FIND("/";A3;FIND("//";A3)+2)))-FIND("//";A3)-2)

If url in A3 field, strips http:// and https:// from A3 and returns only domain name without request URI

如果url在A3字段中,从A3中去掉http://和https://,只返回没有请求URI的域名

#1


4  

I tried this with the http and https versions of your URL (where A3 has your URL); seems to work.

我在您的URL的http和https版本中尝试过(其中A3有您的URL);似乎工作。

=RIGHT(A3,LEN(A3)-FIND("/",A3,FIND("//",A3)+2))

#2


0  

If you are creating 301 rules, adding a "+1" will make sure the "/" is included in the beginning of the path :

如果您正在创建301条规则,添加“+1”将确保“/”包含在路径的开头:

=RIGHT(A3,LEN(A3)-FIND("/",A3,FIND("//",A3)+2)+1)

=正确(A3,LEN(A3)找到(“/”,A3,发现(“/ /”,A3)+ 2)+ 1)

#3


0  

Is it mandatory to be in excel? You can use google sheets and this simple function will autoextract exactly what you need:

是否必须使用excel?您可以使用谷歌表,这个简单的函数将自动提取您需要的内容:

=REGEXEXTRACT(A1,".*\.\w+\/(.*\/*?)")

#4


0  

=RIGHT(LEFT(A3;FIND("/";A3;FIND("//";A3)+2)-1);LEN(LEFT(A3;FIND("/";A3;FIND("//";A3)+2)))-FIND("//";A3)-2)

If url in A3 field, strips http:// and https:// from A3 and returns only domain name without request URI

如果url在A3字段中,从A3中去掉http://和https://,只返回没有请求URI的域名