Announcement

Collapse
No announcement yet.

How to exempt folders from being redirected

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to exempt folders from being redirected

    Today, Trevor upgraded 2 of my forums to 5.5.6.

    There are some folders in the same account such as public_html/foldername1/foldername2/file1.zip

    When going directly to files in those folders there now, it gives an error, "Invalid Page URL. If this is an error and the page should exist, please contact the system administrator and tell them how you got this message."

    How can I exempt files in those folders from being exempt?

    So if I want to download a zip from forumname.com/foldername1/foldername2/file1.zip - how do I do this without it redirecting and giving me the error?
    Last edited by energetic-forum; Wed 8th Jan '20, 5:36pm.

  • #2
    This is the first half of the htaccess file - can you give a specific example of what to do to prevent the redirect for the zip file and specific folders?

    <IfModule mod_rewrite.c>
    RewriteEngine On

    # In some cases where you have other mod_rewrite rules, you may need to remove the
    # comment on the following RewriteBase line and change it to match your folder name.
    # This resets the other mod_rewrite rules for just this directory
    # If your site was www.example.com/forum, the setting would be /forum/
    #RewriteBase /

    #If you used friendly urls in vB4, then uncommenting the following rules will redirect the #
    #old vB4 urls to a similar location in vB5. This is unnecesary for a new vB5 install.
    #RewriteRule ^threads/.* showthread.php [QSA]
    #RewriteRule ^forums/.* forumdisplay.php [QSA]
    #RewriteRule ^members/.* member.php [QSA]
    #RewriteRule ^blogs/.* blog.php [QSA]
    #RewriteRule ^entries/.* entry.php [QSA]

    #To redirect users to the secure version of your site, uncomment the lines below
    #RewriteCond %{HTTPS} !=on
    #RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]

    #Block directories that don't need direct access
    RewriteRule ^(core/libraries/|includes|core/includes|core/vb|core/vb5|core/admincp|core/modcp) index.php?routestring=relay/404 [END]

    #Block files and directories
    RewriteRule (^|/)\.(?!well-known) index.php?routestring=relay/404 [END]

    #Block directories that don't need direct access to PHP
    RewriteRule ^(css|fonts|images|js|core/cache|core/cpstyles|core/clientscript|core/customavatars|core/images|core/store_sitemap)/.*\.php index.php?routestring=relay/404 [END]

    # Send css calls directly to the correct file VBV-7807
    RewriteRule ^css.php$ core/css.php [NC,L]

    # Redirect old install path to core.
    RewriteRule ^install/ core/install/ [NC,L]

    # Main Redirect
    RewriteCond %{REQUEST_URI} !\.(gif|jpg|jpeg|png|css)$
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?routestring=$1 [L,QSA]
    </IfModule>
    Last edited by energetic-forum; Thu 9th Jan '20, 12:05am.

    Comment

    Related Topics

    Collapse

    Working...
    X