I have an additional problem based on this. In my files directory (called 'resources') I have subfolders of some content types that contain the content types files. One content type is called 'Tutorials' and I have a views page that lists all tutorials. I want a URL that goes http://example.com/resources/tutorials that links to this view page, but I cannot get it to work with the above method. Can anybody help?
Comments
If your files directory is,
If your files directory is, for example,
filesthen try this. In your .htaccess file change the last block of linesto
Then you should be able to use the
filespath as an alias and still access the files under it.Thanks for your reply, but
Thanks for your reply, but at the moment my files .htaccess has:
SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006
Options None
Options +FollowSymLinks
I pasted your suggestion but it did not work...?
Not that one. That is only
Not that one. That is only for security purposes. I meant the main .htaccess file in Drupal's directory.
It is not working. My files
It is not working. My files directory has been renamed to 'resources' so I have changed the .htaccess to:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d [OR]
RewriteCond %{REQUEST_URI} ^/resources/$
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
Should this still work even though it is not 'files'?
Thanks
Yes, it should work if that
Yes, it should work if that directory is located under your web root (if it is http://www.example.com/resources)
What exactly happens when you go there?
I get a 404 error 'Not
I get a 404 error 'Not Found'. Could the error be that I am viewing it from my local host e.g. http://localhost/example/resources?
In that case, try
In that case, try
^/example/resources/$All Good
All good it was a localhost problem. I tried it online and your original idea worked perfect.
Thanks for your help!
Help Again
I have an additional problem based on this. In my files directory (called 'resources') I have subfolders of some content types that contain the content types files. One content type is called 'Tutorials' and I have a views page that lists all tutorials. I want a URL that goes http://example.com/resources/tutorials that links to this view page, but I cannot get it to work with the above method. Can anybody help?
To let the subdirectories be
To let the subdirectories be handled by Drupal as well, try removing the last
$from the previous method:If this does not work, and makes your files not appear in the view, then try adding lines for the additional subdirectories:
Heh, usually people try to do the opposite, to make Drupal leave their subdirectories alone, not to take them over.
Both ways worked like a
Both ways worked like a charm, much appreciated.
Nice, I was worried that
Nice, I was worried that with the first method the file links wouldn't work.