欢迎页面之前字preSS(次目录中安装) [英] Welcome page before WordPress (sub directory install)

查看:119
本文介绍了欢迎页面之前字preSS(次目录中安装)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

  1. 我安装了Word preSS到一个子目录: example.com/wp

  2. 我用<一个href="https://$c$cx.word$p$pss.org/Giving_Word$p$pss_Its_Own_Directory#Using_a_$p$p-existing_subdirectory_install"相对=nofollow>重写规则服务字preSS从我的根URI: example.com

#BEGIN字preSS
&LT; IfModule mod_rewrite.c&GT;
RewriteEngine叙述上
的RewriteBase /
重写规则^指数\ .PHP $  -  [L]
的RewriteCond%{} REQUEST_FILENAME!-f
的RewriteCond%{} REQUEST_FILENAME!-d
重写规则。的index.php [L]
&LT; / IfModule&GT;
#结束字preSS

<醇开始=3>

  • 我想提供一个欢迎页面项目启动: example.com/welcome.html
  • 这将有一个简单的欢迎消息,并应重定向到我的字preSS工作版本。我有在Word preSS启用pretty的网址。从我的 welcome.html 页我可以链接到 example.com/about ,例如,它会显示关于我的Word preSS页面(如预期)。

    不过,我不能链接到我的字preSS主页。我使用的是静态页面,我的字preSS头版(姑且称之为启动)。当我链接到 example.com/wp ,它会在我的Word preSS发出一个错误404。当我链接到 example.com/start ,它会重定向到我的 welcome.html 页。


    听起来很混乱?希望你还是跟我一起。我真正想要的:

    一)直接访问用户 example.com 应该看到欢迎页面。

    b)它们单击欢迎页面上的链接,让我的字preSS回家。

    c)如果在Word preSS导航,他们不应该被重定向到欢迎页面。

    因为我想以后几个星期删除欢迎页面,我想保持尽可能简单(用于Word preSS或都没有新的头版模板)。

    有没有什么解决方案来设置 welcome.html 我的的DirectoryIndex ,使所有其他请求重定向到我的字preSS安装包括的话语preSS的家?我的主要问题是,我的不能访问字preSS主页现在(没有 example.com/wp example.com/start example.com/wp/start 作品),不同于任何其他的静态页面( example.com/about 正常工作)。

    解决方案

    我终于结束了使用这一行的插件禁用典型URL重定向:

     &LT; PHP
    
    remove_filter('template_redirect','redirect_canonical');
    
    ?&GT;
     

    此外,我重新配置的话preSS URI的常规设置面板上。现在我可以两个,叫我的博客主页,并访问所有子页面,而不会被重定向到一个错误404。

    现在我有我的的.htaccess 做一个的DirectoryIndex welcome.html ,所以我的观众看到飞溅页面第一。欢迎页面有一个链接到我的的index.php 页供应字preSS。在博客上工作的所有环节。

    在我的项目启动,我会简单地删除的DirectoryIndex ,删除上面的插件,code和重置我的常规设置。

    1. I installed WordPress to a sub directory: example.com/wp

    2. I use a rewrite rule to serve WordPress from my root URI: example.com

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

    1. I want to provide a welcome page for project launch: example.com/welcome.html

    It will have a simple welcoming message and should redirect to a working version of my WordPress. I do have pretty URLs enabled in WordPress. From my welcome.html page I can link to example.com/about, for example, and it will show the about page of my WordPress (as expected).

    However, I cannot link to the home page of my WordPress. I use a static page for my WordPress front page (let's call it start). When I link to example.com/wp, it will issue an error 404 in my WordPress. When I link to example.com/start, it will redirect to my welcome.html page.


    Sounds confusing? Hope you are still with me. What I actually want:

    a) Users that directly access example.com should see the welcome page.

    b) They click a link on the welcome page and get to my WordPress home.

    c) When navigating within WordPress, they should not be redirected to the welcome page.

    Since I want to remove the welcome page after a couple of weeks, I want to keep it as simple as possible (no new front page template for WordPress or alike).

    Is there any solution to set welcome.html as my DirectoryIndex and make all other requests redirect to my WordPress installation including the WordPress home? My major problem is that I cannot access the WordPress home page right now (neither example.com/wp, nor example.com/start or example.com/wp/start work), unlike any other static page (example.com/about works fine).

    解决方案

    I finally ended up using this one-line plugin to disable canonical URL redirects:

    <?php
    
    remove_filter('template_redirect', 'redirect_canonical');
    
    ?>
    

    Furthermore, I reconfigured the WordPress URI on the General settings panel. Now I can both, call the home page of my blog and access all sub-pages, without being redirected to an error 404.

    Now I'll have my .htaccess do a DirectoryIndex welcome.html, so my visitors see the splash page first. The welcome page has a link to my index.php page which serves WordPress. All links within the blog work.

    When my project is launched, I will simply remove the DirectoryIndex, delete the above plugin code and reset my General settings.

    这篇关于欢迎页面之前字preSS(次目录中安装)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆