簡體   English   中英

在wordpress .htaccess中重寫網址

[英]rewriting urls in wordpress .htaccess

對於wordpress和服務器管理員來說,我是新手,我只是在本地目錄的子文件夾中安裝了一個wordpress博客。 但是我在配置.htaccess時遇到問題。 安裝wordpress的文件夾稱為onlifestyle,位於根目錄中。 我的網址格式為: http : //onlifestyle.org/onlifestyle/health/basic-principles-of-proper-nutrition而不是http://onlifestyle.org/health/basic-principles-of-proper-nutrition我的根。 htaccess是:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www.)?onlifestyle.org$
RewriteRule ^(/)?$ onlifestyle/$1 [NC,L]

wordpress .htaccess:

 # BEGIN WordPress
    <IfModule mod_rewrite.c>
        RewriteEngine On
        RewriteRule ^index\.php$ - [L]
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteRule . /onlifestyle/index.php [L]
    </IfModule>
#END WordPress

和我使用永久鏈接:

http://onlifestyle.org/onlifestyle/%category%/%postname%

我應該如何配置wordpress以便跳過URL中子目錄的名稱

除了.htaccess文件,您必須在Wordpress設置中設置正確的URL。 另請參閱: http : //codex.wordpress.org/Giving_WordPress_Its_Own_Directory

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM