草庐IT

request_filename

全部标签

.htaccess - 使用 .htaccess 切换语言

我想在我的网站上添加另一种语言(一个用PHP7编写的应用程序)。我发现,良好的SEO实践表明,我网站上的每个页面都应该可以从不同的URL访问,具体取决于语言。目前我的.htaccess看起来像这样:RewriteEngineonOptions+FollowSymLinksRewriteBase/RewriteCond%{REQUEST_FILENAME}!-fRewriteCond%{REQUEST_FILENAME}!-dRewriteCond%{REQUEST_FILENAME}.php-fRewriteRule^([a-zA-z0-9-]+)$$1.php[NC,L]所以当用户输

.htaccess - 没有 index.php 的查询字符串

我希望我的网址看起来像这样:“http://www.example.com/start”,而不是这样:“http://www.example.com/index.php/start”。这适用于我的.htaccess中的这段代码:RewriteEngineOnRewriteCond%{REQUEST_FILENAME}!-fRewriteCond%{REQUEST_FILENAME}!-dRewriteRule^(.*)$/index.php?/$1在一个页面上,我必须使用GET-Parameters,url应该如下所示:“http://www.example.com/artists/p

c# - ASP.NET WebForms : Request. GetFriendlyUrlFileVirtualPath() 返回空字符串

我有一个只有几页的简单ASP.NETWebForms项目,我想使用友好的URL(不仅用于SEO,还用于URL本地化)。我在这个项目中使用.NET4.5,并尝试使用Microsoft.AspNet.FriendlyUrlsnuget包,看起来可能会有帮助。但是有一个问题。我在Global.asax中得到了这个:voidApplication_Start(objectsender,EventArgse){//CodethatrunsonapplicationstartupBundleConfig.RegisterBundles(BundleTable.Bundles);RouteConfi

.htaccess - 如何使用 php 在我的目录中创建友好的 url

我使用这些类型的URL:http://test.com/rest/api.php?action=test但我需要这些类型的URL:http://test.com/rest/api/action/test我尝试在此处.htaccess归档这些代码RewriteEngineOnRewriteCond%{REQUEST_FILENAME}!-dRewriteCond%{REQUEST_FILENAME}!-sRewriteRule^(.*)$api.php?rquest=$1[QSA,NC,L]RewriteCond%{REQUEST_FILENAME}-dRewriteRule^(.*)$

.htaccess - Laravel 应用程序中的站点地图

我想为我的网站制作一个用Laravel框架制作的站点地图。Laravel应用程序中的默认.htaccess文件如下所示:Options-MultiViewsRewriteEngineOn#RedirectTrailingSlashes...RewriteRule^(.*)/$/$1[L,R=301]#HandleFrontController...RewriteCond%{REQUEST_FILENAME}!-dRewriteCond%{REQUEST_FILENAME}!-fRewriteRule^index.php[L]据我所知,这个.htacces将每个请求重定向到index.p

c# - 使用 WP Rest API Request C# 添加 SEO

我正在使用WPRestAPIv2在Wordpress上发帖,并使用AllInOneSEOPack进行SEO,但我没有知道我应该给什么参数来添加元标题、元描述和元标签。我有以下代码:varrequest=(HttpWebRequest)WebRequest.Create(Website+"wp-json/wp/v2/posts/");request.Headers["Authorization"]="Bearer"+token;request.Method="POST";request.UseDefaultCredentials=true;varpostData="title="+Tit

yii : how to config SEO friendly url at Yii?

我通过yiic创建了一个应用程序。然后我尝试制作一个SEO网址。我在[approot]/protected/config/main.php取消注释urlManager。我将以下内容添加到[approot]/.htaccess中。RewriteEngineonifadirectoryorafileexists,useitdirectlyRewriteCond%{REQUEST_FILENAME}!-fRewriteCond%{REQUEST_FILENAME}!-dotherwiseforwardittoindex.phpRewriteRule.index.php当我浏览[app]/si

php - (SEO + htaccess) 带有分页和页面详细信息的页面列表

我对SEO-PHP有疑问。我有2个页面:新闻列表页面和新闻详细信息页面。但是,从SEO的角度来看,如何区分URL中的这两个页面?目前,我正在使用这些URL:www.site.com/it/news/page-1/-www.site.com/it/news/page-2/...(带分页的新闻列表)www.site.com/it/news/title-news-detail/(新闻详情)我的文件.htaccess代码:#firstparameterRewriteCond%{REQUEST_FILENAME}!-fRewriteCond%{REQUEST_FILENAME}!-dRewrit

php - 用于 SEO 友好 URL 的 mod_rewrite

我有一个CMS,可以处理使用CMS创建的SEO友好URL。因此,任何像www.url.com/index.php?id=slug这样的index.php的扩展都可以很好地更改为www.url.com/鼻涕虫。但是,我还有超过一千个页面是使用未连接到我的CMS的MYSQL查询字符串创建的。所以我有:www.url.com/item.php?id=001234&pg=author-titleid和pg中的信息是生成页面所必需的。我想要的是这些页面url是:www.url.com/item/001234/author-title.html我看了很多mod_rewrite教程,寻找所有的方法来

php - 使用 htaccess 的多个 rewriterole url

我的网站有两种语言。(en/fr)。en是默认语言,我用这个url显示:mydomain.com/mydomain.com/news.php?id=XX对于第二语言,我有这个网址:mydomain.com/index.php?lang=fr现在我使用.htaccess重写url,如下所示:RewriteEngineOnRewriteBase/RewriteRule^(fr)(/)?$index.php?lang=$1[QSA,L]RewriteCond%{REQUEST_FILENAME}!-fRewriteCond%{REQUEST_FILENAME}!-dRewriteRule^(