Skip to main content

Posts

Showing posts with the label drupal

Access image and other files from Server on drupal local setup using .htaccess

You have local installation of drupal 7. Suppose its 'http://tms.devs' and its live suppose 'www.example.com'. Now you have the database of live site and also the latest files except the image files. Now you don't want to download all the images from server. to keep your local development environment light. So you can access the files from the live server using .htaccess file.  To access the files Form server  write the following codes to your root .htaccess file:  RewriteCond %{REQUEST_URI} ^/sites/default/files/(.*)$ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$  http://example.com/$1  [L,QSA]