.htacces RewriteRule results all wordpress pages in a not found

  • Unknown's avatar

    Hi,

    I need to block all files an folder in a specific directory.

    My .htaccess files now looks like this :

    RewriteEngine On
    RewriteCond %{REQUEST_URI} /hosted/(.*)
    RewriteRule (.*) http://www.mywebsite.be/hosted/$1 [R=410,L]

    # 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

    My prema links setting is on “Post Name” – so yes normally the wordpress rewrite should be uncommented. Like this :

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

    But the my original :

    RewriteEngine On
    RewriteCond %{REQUEST_URI} /hosted/(.*)
    RewriteRule (.*) http://www.mywebsite.be/hosted/$1 [R=410,L]

    Does not have any effect.

    The blog I need help with is: (visible only to logged in users)

  • Unknown's avatar

    * My first example how i have it – results that all pages get not found (except my main index page) and the blocked rewrite responds correctly with a 410.

    * Second Example if i uncomment, the block does not work anymore.

  • The topic ‘.htacces RewriteRule results all wordpress pages in a not found’ is closed to new replies.