Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7174657
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T16:06:12+00:00 2026-05-28T16:06:12+00:00

Currently, my .htaccess file looks like this: RewriteCond %{SCRIPT_FILENAME} !-f RewriteCond %{SCRIPT_FILENAME} !-d RewriteRule

  • 0

Currently, my .htaccess file looks like this:

RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule /album2 /galleries/album2 [QSA,L]

RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule /album /galleries/album [QSA,L]

RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^(.*\.exe)$ /slideshows/$1 [QSA,L]

RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule (.*) /photos/$1 [QSA,L]

That seems a bit messy to me because I repeat those checks for directories and files a lot. There must be a better way to do this.

What I am trying to accomplish is redirecting to different folders depending on if the file or folder being requested exists. Everything use to be in the root directory of the site, but that was becoming unmanageable. I’d like the script to basically check if these if files or folders exist in a few different directories and if they do, redirect to it.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T16:06:14+00:00Added an answer on May 28, 2026 at 4:06 pm

    All cleaned up, and a mint on your pillow 🙂

    RewriteCond %{ENV:REDIRECT_STATUS} 200 [OR]
    RewriteCond %{SCRIPT_FILENAME} -f [OR]
    RewriteCond %{SCRIPT_FILENAME} -d
    RewriteRule ^ - [L]
    
    RewriteRule /album2 /galleries/album2 [L]
    
    RewriteRule /album /galleries/album [L]
    
    RewriteRule ^(.*\.exe)$ /slideshows/$1 [L]
    
    RewriteRule (.*) /photos/$1 [L]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Currently, my .htaccess file looks like htis: IndexIgnore */* RewriteEngine on RewriteRule ^add /add.php
Currently my .htaccess looks like this... Options +FollowSymLinks RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME}
My current htaccess file looks like this: RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f [NC] RewriteCond
My .htaccess file currently looks like this AddType x-mapp-php5 .php Options +FollowSymLinks Options +Indexes
My current .htaccess looks like this: RewriteEngine On # RewriteCond %{REQUEST_URI} !^/_project RewriteCond %{REQUEST_FILENAME}
Currently my htaccess file contains this rule, to redirect website.org/index.php to website.org/en/home RewriteRule index.php
I have a .htaccess file that looks like this: SetEnv APPLICATION_ENV development RewriteEngine On
My current htaccess looks like this: RewriteEngine On RewriteCond %{HTTP_HOST} ^(www\.)?site\.com [NC] RewriteCond %{REQUEST_FILENAME}
My current .htacces file looks like this: DirectoryIndex index.php RewriteEngine on RewriteCond $1 !^(index\.php|assets|robots\.txt|favicon\.ico)
I have a .htaccess file that currently looks like: <Files .htaccess> order allow,deny deny

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.