首页 \ 问答 \ 如何在nginx上使用WordPress永久链接?(What to do with WordPress permalink on nginx?)

如何在nginx上使用WordPress永久链接?(What to do with WordPress permalink on nginx?)

我昨天开始使用VPS,我安装了WordPress并完成了基本设置。 但永久链接的交易是什么? 没有人希望使用默认的丑陋URL结构。 我试图理解http://wiki.nginx.org/WordPress,但有趣的是“我不知道在哪里插入这些代码”。 他们可能认为他们所有的读者都知道nginx,这并不好笑。

所以,我很确定.htaccess在nginx中不起作用。 怎么办? 在哪里放置哪些代码使自定义固定链接工作? PS:你知道,如果我设置了一个自定义永久链接,那么输出就像404页面一样:

在此处输入图像描述

所以,我想要一个简单的指南,告诉你“编辑demo.php文件并放在X后的代码下面”。

附加信息:我的webroot是/ usr / share / nginx / html,我有两个WordPress。 第一个:/ usr / share / nginx / html目录和第二个:/ usr / share / nginx / html / video目录。 我想要两个都很漂亮的网址。 我chmod wp-content为775。


I started a VPS yesterday and I installed WordPress and have done basic setup. But what is the deal with permalink? No one wish to use default ugly URL structure. I tried to understand http://wiki.nginx.org/WordPress but funny thing is "I don't know where to insert those codes". They probably think all of their readers are well known with nginx, that's not funny.

So, I am pretty sure .htaccess is not working in nginx. Now what? Where to place which code to make Custom permalink work? P.S: You know, if I set a custom permalink then the output is 404 page like:

enter image description here

So please, I want a simple guide that tell like "edit demo.php file and place below code after X".

ADDITIONAL INFO: My webroot is /usr/share/nginx/html, and I have two WordPress there. First: /usr/share/nginx/html directory and second: /usr/share/nginx/html/video directory. I want pretty url for both of them. I chmod wp-content to 775 for both.


原文:https://stackoverflow.com/questions/27990933
更新时间:2022-07-03 18:07

最满意答案

Activator.CreateInstance能够在运行时创建实例。 使用form参数作为激活器的类型,并将CreateInstance方法CreateInstanceForm

var form = ( Form ) Activator.CreateInstance( frm.GetType() );

Activator.CreateInstance is able to create instances in runtime. Use your form parameter as type for the activator and cast the CreateInstance method to Form

var form = ( Form ) Activator.CreateInstance( frm.GetType() );

相关问答

更多
  • 工厂式方法如何? def form_factory(class_name, base, field_dict): always_has = { 'airspeed_velocity': forms.IntegerField(some_important_details_here), 'is_migratory': forms.BooleanField(more_important_details) } always_has.update(field_d ...
  • 如果您使用Apps脚本创建表单,然后为该表单创建表单提交触发器,则您创建的触发器将附加到脚本 ,而不是新表单。 这就是您遇到20个触发器/用户/脚本配额限制的原因 。 请记住,触发器存在于脚本上,而不是Docs,Sheets或Forms。 您可以使用脚本创建新表单,但不能使用脚本创建附加到该表单的新脚本(脚本无法创建其他脚本)。 这意味着您无法以编程方式创建生活在另一个文档上的触发器。 你可以做的是创建一个Forms加载项,当创建一个新表单时,用户可以点击一个菜单控件来为该表单创建一个表单提交触发器。 If ...
  • Activator.CreateInstance能够在运行时创建实例。 使用form参数作为激活器的类型,并将CreateInstance方法CreateInstance为Form var form = ( Form ) Activator.CreateInstance( frm.GetType() ); Activator.CreateInstance is able to create instances in runtime. Use your form parameter as type for ...
  • 您要查找的是将窗体显示为模式对话框。 Form.ShowDialog() 在这里,您可以阅读有关此主题的更多信息。 您可以通过几种方式访问父表单(后表单): 使模态表单构造函数从as参数接受parent 将父表单引用放入可以从模态表单访问的某个全局变量中 ... 要从子表单中获取事件,您可以执行以下操作: form.myListBox.SelectedIndexChanged += new System.EventHandler(this.myListBox_SelectedIndexChanged); f ...
  • 显然隐藏表单比你指望的更有影响力。 您的代码参与了Microsoft在Winforms上进行的安全审核。 非常彻底,在行为方式上不常见,但在源代码中非常明显。 一条规则是强制用户永远不应失去对应用程序的控制权。 这样一个对话很麻烦。 核心问题是ShowDialog()创建一个模式窗口,禁用所有其他窗口。 这为恶意软件创造了机会,非常容易利用,所有它必须做的就是隐藏一个对话框,然后你嘲笑用户。 用户无法再次获得对应用程序的控制权。 启用的一个窗口是隐藏的,用户无法再次重新激活它。 所有其他窗口都被禁用,因此尝 ...
  • 框架仍然坚持你的表单对象,直到它被关闭。 您可以使用My.Application.OpenForms获取对它的引用。 The framework is still holding on to your form object, until it gets closed. You can get a reference to it using My.Application.OpenForms.
  • 也许从表单2中获取所有输入,用前缀重命名所有输入,并将它们附加到表单1? 这正是你必须要做的。 没有代码示例,答案不会太大,所以你走了。 $("#form2 :input").appendTo("#form1")[0].submit() 现在在php中你将有$_POST['thing']包含一个包含两个值的数组。 或者,您可以重命名form2中的所有输入: $("#form2 :input").attr("name",function(name){ return name + "_form2"; ...
  • 简短的回答是肯定的,你的一些问题是由于这些操作的静态特性造成的。 您应该能够通过从Zip类中删除静态声明然后根据需要创建它的实例来解决问题。 The short answer is yes, some of your problems are due to the static nature of those operations. You should be able to resolve the problem by removing the static declarations from your ...
  • 这种东西很快变得一团糟。 出于这个原因,你应该在像meta_search这样的宝石的帮助下寻求更易于维护的解决方案。 This kind of stuff becomes quickly a mess. For this very reasons, you should go for a more maintainable solution with the help of a gem like meta_search.
  • 您可以根据需要使用一个表单。 可以直接在字段上添加一些注释,例如@NotNull for address1,如果它对所有用户类型都是必需的。 您的use类应具有标记注释@Valid以验证地址和联系人 public class User { ... @Valid private Address address; @Valid private Contact contact; ... } 您可以定义类级约束注释和/或交叉参数约束。 (参见示例 )。 因此,您的U ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)