Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Jan 2016
    Posts
    239
    Thanks
    50
    Thanked 3 Times in 3 Posts

    redirect one level down with htaccess, how?

    Hello,

    I have a blog at:

    mydomain.com/blog/

    When users do not find pages there I would like to redirect them to a 404 page here:
    mydomain.com/404.php

    I added an htaccess file here:

    mydomain.com/blog/.htaccess

    With the below details

    But it seems to not accept my ../

    RewriteEngine On
    ErrorDocument 404 ../404.php
    ErrorDocument 500 ../404.php
    ErrorDocument 403 ../404.php
    ErrorDocument 400 ../404.php
    ErrorDocument 401 ../404.php


    Any idea how to get this working please/

    Thank you.

  2. #2
    Regular Coder
    Join Date
    Jan 2016
    Posts
    239
    Thanks
    50
    Thanked 3 Times in 3 Posts
    Ok got it working with this

    RewriteEngine On

    RewriteCond %{HTTP_HOST} ^website\.com$
    RewriteRule (.*) https://www.website.com/$1 [R=301,L]
    RewriteRule ^$ 404.php [L]


 

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •