Allow access to non-drupal directory

Home

Allow access to a non-drupal dir

If you install drupal into your root directory and have directories that were created outside of drupal, when you try and access the non drupal directory such as something.com/somedir  you will recieve a "The requested page "/something" could not be found." from drupal despite the fact that the directory somesite.com/something
does really exist. You need to edit you .htaccess that is in your root directory, you can use vim if you are comfortable in a shell or you can access your hos via ftp copy the .htaccess fiel off edit it then copy it back to your root firectory once you finishes editing it the choice is yours.

If you use nautilus file manager you will need to do ctrl+h or click View then select Show Hidden Files in order to see the .htaccess file to open it as it is a hidden file. Once you got the file open for editing you will need to add the following section:

user@something.com [~/public_html]#vim .htaccess [RETURN]

<IfModule mod_rewrite.c>
  RewriteEngine on

  ###############################################
  ###    ACCESS TO NON DRUPAL DIRECTORIES       ###
  ###############################################

  RewriteCond %{REQUEST_URI} "/somedir/"
  RewriteRule (.*) $1 [L]
  DirectoryIndex index.php index.html index.htm
  Options +Indexes

  ###############################################
  ###    END OF NON DRUPAL DIR SECTION               ###
  ###############################################

:wq

 

Once you finished editing the .htaccess file copy it back to your root directory & now when you try and access somesite.com/somedir you will now see the contents of that directory whether it be a webpage or some documents etc and will no longer see the drupal 404 error.