Forums

[resolved] Blog URL and .htaccess (7 posts)

  1. boon_
    Member
    Posted 2 years ago #

    I have amended my blog URL with the ending /about/blog/ which is where my blog is located.

    Following this I now get /about/blog in front of every sub page of my website. e.g. /about/blog/about/sitemap instead of /about/sitemap

    I thought it was because I needed to amend my .htaccess file (as stated by WP) to this:

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /about/blog/
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /about/blog/index.php [L]
    </IfModule>

    But when I amend it to this I get Error 500 Internal Server Error everywhere.

    Does anyone have any ideas on how can I fix this problem?
    Thanks

  2. Samuel B
    moderator
    Posted 2 years ago #

    delete the .htaccess
    regenerate permalinks with wordpress
    admin - settings - permalinks

  3. Mark / t31os
    Moderator
    Posted 2 years ago #

    Due to these lines.

    RewriteBase /about/blog/
    RewriteRule . /about/blog/index.php [L]

    Naturally that will result in about/blog/about/blog/ ... (i think)..

    If you don't mind editting you could just update this line.
    RewriteRule . /about/blog/index.php [L]
    to...
    RewriteRule . /index.php [L]

    Might wanna give samboll's suggestion a whizz first though.. ;)

  4. Samuel B
    moderator
    Posted 2 years ago #

    @ t31os_
    that should work as well
    doing it within wordpress sort of insures the internal rewrite

  5. Mark / t31os
    Moderator
    Posted 2 years ago #

    If the permalink settings are the same though, then no updates to the database will be made (it's only one entry iirc), essentially all it will do is update the htaccess file with the change i mentioned.

    Agreed though, let WordPress try to do it first, and modify if all else fails... :)

  6. boon_
    Member
    Posted 2 years ago #

    Hmmm it doesn't seem to be able to update the .htaccess remotely, even though it is set to 777.

    I've tried t31os's suggestion of editing the RewriteRule but it still does the same /about/blog/ thing.

    Even after resetting permalinks it still says I need the .htacess I listed in my first post.

  7. Mark / t31os
    Moderator
    Posted 2 years ago #

    Even after resetting permalinks it still says I need the .htacess I listed in my first post.

    What says that? WordPress? ... are you sure the htaccess file is correct, it's not got an incorrect extension or something silly?

    Try deleting the one you have, upload a blank text document (New Text Document.txt on windows), then rename it (.htaccess) once it's transferred via http://FTP...

    Set permissions to 777, and update the permalink settings again... (only whilst it needs updating, it should be 644 for normal operation, or 666/664 if 644 won't work).

Topic Closed

This topic has been closed to new replies.

About this Topic