dongyan1808
2017-11-03 15:51
浏览 106
已采纳

使用Wordpress Rewrite或.htaccess重写URL

I'm trying to append to wordpress an additional parameter into my URL. For example, I have the URL: http://example.com I want to change that to URL: http://example.com/this-example/

I'm thinking I can do this is in htaccess along the lines of a rewrite condition, but i'm unsure how to go about this. This is what I was thinking here.

Htaccess

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
RewriteEngine on
RewriteRule ^/this-example/(.*)/ /index.php?$1 [L]
</IfModule>
Options -Indexes

图片转代码服务由CSDN问答提供 功能建议

我正在尝试将附加参数附加到wordpress中。 例如,我有一个URL: http://example.com 我想将其更改为网址: http://example.com/this-example/

我在想我能做到这一点 是在重写条件下的htaccess,但我不确定如何去做。 这就是我在这里想的。

Htaccess

 &lt; IfModule mod_rewrite.c&gt; 
RewriteEngine  On 
RewriteBase / 
RewriteRule ^ index \ .php $  -  [L] 
RewriteCond%{REQUEST_FILENAME}!-f 
RewriteCond%{REQUEST_FILENAME}!-d 
RewriteRule。  /index.php [L] 
RewriteEngine on 
RewriteRule ^ / this-example /(.*)/ /index.php?$1 [L] 
&lt; / IfModule&gt; 
Options -Indexes 
   
 
  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

1条回答 默认 最新

相关推荐 更多相似问题