WordPress.org

Ready to get started?Download WordPress

Forums

Pointing URL to sub-directory (8 posts)

  1. judetheobscure
    Member
    Posted 1 year ago #

    I've read http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory and it all looked quite straightforward - but obviously not for me.

    I've got wordpress in a subdirectory labelled wordpress.

    I got the code

    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^(www.)?YourDomain.com$
    RewriteRule ^(/)?$ blog [L]

    and I altered it to:

    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^(www.)?joe-music.net$
    RewriteRule ^(/)?$ blog [wordpress]

    but I'm getting a 500 error code - internal server error.

    What have I got wrong?

    (PS. I've put the original htaccess file back so the site looks normal at the moment. Site is http://www.joe-music.net and wordpress version is at http://www.joe-music.net/wordpress

    Thanks for reading.

  2. David Choi
    Member
    Posted 1 year ago #

    Try this

    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^(www.)?joe-music.net$
    RewriteRule ^(/)?$ wordpress/blog [L]
  3. judetheobscure
    Member
    Posted 1 year ago #

    Thank you.

    Do I need the /blog bit - I don't have a page with that address?

  4. David Choi
    Member
    Posted 1 year ago #

    I am going to do some tests on this (never needed to do this), will get back to you soon.

  5. David Choi
    Member
    Posted 1 year ago #

    Okay, did some tests on my server. Based on your .htaccess code, you are trying to redirect to your subdirectory, whenever people visit your domain, correct? Then it should be

    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^(www.)?joe-music.net$
    RewriteRule ^(/)?$ wordpress [L]

    if your folder name is "wordpress", it worked on my test server. Now, I also tried following the instructions at

    http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory

    to copy only the index.php to the root, so all the wordpress files are under a folder called "wp", well, that didn't work for me. Don't know if it's not compatible with latest WordPress 3.4.1.

  6. judetheobscure
    Member
    Posted 1 year ago #

    For the time being I just want to redirect the domain to the subdirectory so will give your code a whirl - thank you :)

    - should have realised that it was the word "blog" that needed replacing, not that bit in the brackets but you learn by experience ;)

    Hope you get some joy with your index.php thing.

  7. David Choi
    Member
    Posted 1 year ago #

    Okay, glad that was what you are looking for and solved the problem.

    Will continue my journey with the index.php thing, :)

  8. judetheobscure
    Member
    Posted 1 year ago #

    Thank you again - worked fine :D

Topic Closed

This topic has been closed to new replies.

About this Topic