Support » Plugin: Cleverwise Redirect It » Basic task?

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Jeremy O'Connell

    (@cyberws)

    This plugin won’t accomplish that task. However WordPress supports that out of the box, although it is best if the files are installed in a directory on the same server.

    Anyway what you do is go to “Settings” then “General”. You’ll see “WordPress Address (URL)” and “Site Address (URL)”.

    WordPress Address (URL) would be your http://wp.mysite.com/wp
    Site Address (URL) would be http://www.mysite.com

    Sorry one last step is you need update your .htaccess file to load the index.php in wp.mysite.com/wp or copy the index.php to your main site directory and then edit that file to load from the /wp directory. That is why the files should be on the same server.

    Then save changes. That’s it.

    Hi Jeremy,

    Thanks for that – if I do that, I just get this returned:

    Warning: require(/home/www/mysite.com/wp-blog-header.php) [function.require]: failed to open stream: No such file or directory in /home/www/mysite.com/index.php on line 17

    Fatal error: require() [function.require]: Failed opening required ‘/home/www/mysite.com/wp-blog-header.php’ (include_path=’.:/usr/local/php5.3/lib//php’) in /home/www/mysite.com/index.php on line 17

    Is this an easy fix?

    Thanks for your help,
    Jim

    Plugin Author Jeremy O'Connell

    (@cyberws)

    The way to really do this is install wp into a subdirectory say:

    http://www.mysite.com/wp/ where /wp/ is obviously a directory.

    or

    http://www.mysite.com/content/ where /content/ is obviously a directory.

    Then copy the index.php from the WordPress directory say /wp/ to just the website root.

    Next open up index.php (download if need be) and look for:

    require('./wp-blog-header.php');

    Add your subdirectory to the line (if wp was your directory then):

    require('./wp/wp-blog-header.php');

    Save this file (and upload if edited it off server).

    WordPress will now load when someone visits your http://www.mysite.com even though WP isn’t installed there.

    The final step is editing the .htaccess so any non existing file will be automatically redirected to WP.

    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]

    Hi – ok, sorry, nearly there I think! I’ve copied the index.php file to the root and updated the absolute path to the wp install – but still have this error now:

    Warning: require(/home/www/cache-media.comhttp://wp.cache-media.com/wp/wp-blog-header.php) [function.require]: failed to open stream: No such file or directory in /home/www/cache-media.com/index.php on line 17

    Fatal error: require() [function.require]: Failed opening required ‘/home/www/mysite.comhttp://wp.mysite.com/wp/wp-blog-header.php’ (include_path=’.:/usr/local/php5.3/lib//php’) in /home/www/mysite.com/index.php on line 17

    Looks like the paths are all messed up but I only entered the full path to the wp install?

    Maybe this doesn’t work with a sub domain, only a sub dir?

    Plugin Author Jeremy O'Connell

    (@cyberws)

    You can’t use a URL. It must be a directory readable by the main site. You can use a subdomain if that directory is readable from the host site.

    For example in many hosting panels when creating a subdomain a directory is created under the home directory.

    wp.mysite.tld points to: /home/mysite.tld/public_html/wp/

    require('./wp/wp-blog-header.php');

    Or if you aren’t using a hosting panel as long as that directory is readable by WP it would work too.

    http://www.mysite.tld is at /home/mysite.tld/public_html

    wp.mysite.tld is at home/wpmysite.tld/public_html

    So again if mysite.tld could read /home/wpmysite.tld/public_html you would be okay. In that case:

    require('/home/wpmysite.tld/public_html/wp-blog-header.php');

    It just depends on your internal server setup. However for the sake of making it easier it just better to install /wp/ in a subdirectory on the main site. That will accomplish everything you want in keeping the main URL at the top just mysite.tld. Of course it is your call.

    All sorted – changed the path and hey presto! Thanks so much for your help,

    Best,
    Jim

    Plugin Author Jeremy O'Connell

    (@cyberws)

    Good deal.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Basic task?’ is closed to new replies.