Questions tagged [.htaccess]

Use it for questions about the configuration file used from the Apache server, the .htaccess file.

Filter by
Sorted by
Tagged with
0
votes
1answer
578 views

Upgrading to 7.26 - Internal Server Error

I recently upgraded from Drupal 7.25 to 7.26 in maintenance mode. The upgrading did not have any errors. Now when I go to the homepage I get an Internal Server Error. I added an echo statement to ...
0
votes
1answer
559 views

Can't install modules from UI when site placed in subdirectory

I have Drupal 8 installed in a subfolder (www.example.com/drupal), and I have my root .htaccess configured to mask the subfolder (i.e. the URLs resolve to www.example.com; /drupal does not appear in ...
0
votes
3answers
1k views

How to set and use direct files folder path in a multisite installation

Drupal 8 multisite install where First site is on a subdomain one.example.com Second site is in a subfolder one.example.com/two How can files folder for both sites to be accessible via URL/files ...
0
votes
2answers
355 views

404 on index.php?q=admin

I restored my Drupal 7 site from backup and now can't get to the admin page. Getting a Drupal 404 page on example.com/index.php?q=admin as well as example.com/?q=admin. Needless to say admin/ also ...
3
votes
3answers
8k views

redirect whole site to HTTPS

When I include the snippet found in answer to this question How to simply make the whole site HTTPS? to redirect to https in my htaccess.php file, all urls resove to /index instead of going to the ...
1
vote
1answer
367 views

Alternative to .htaccess compression with Boost

My hosting provider doesn't support mod_deflate directives in .htaccess to provide compressed HTTP responses. I am using Drupal 7 with Boost and wish to compress HTML, CSS and JS responses. Is there ...
0
votes
1answer
994 views

Blank screen with no error messages on new server

I have a working Drupal 7 site, built with git, running on 2 different servers, one test server and one server used for staging and production sites. So I know that the site is working. So after ...
1
vote
1answer
2k views

Getting error 'Redirects to external URLs are not allowed by default'

Getting the error after created this .htacces in root folder. RewriteEngine On RewriteBase / RewriteCond %{REQUEST_URI} !^/web RewriteRule ^(.*)$ /web/ I want to redirect visitors to /web folder. I ...
0
votes
1answer
32 views

How do I redirect a domain but keep the URL structure?

I have example.com and example.co.uk. They both point to the same Drupal installation on my server, so both domains load the exact same site. I am now trying to redirect the .co.uk to the .com domain. ...
1
vote
2answers
457 views

Hide url in subdirectory install?

in my site I use version 7 of Drupal and Linux OS on the server, and need to hide the subdirectory of the installation when access by LINK ... explaining better: Current link: www.site.com/folder I ...
0
votes
1answer
366 views

The clean URL test failed. (ubuntu14.04 lts + virtualmin + Apache/2.4.7)

i can't enable clean url. Mod_rewrite is already enabled. Anything i'm missing? here is the conf my apache is running user mode, the document root is in /home/drupal/public_html /etc/apache2/sites-...
2
votes
1answer
478 views

How to redirect all images in the files folder to a default file?

Because we work with DTAP environments, our developers work on their own laptops. To get a good view of the live environment, we copy the PROD database and the files to our own laptop. However, this ...
1
vote
1answer
638 views

How to eliminate direct access to files in private directory?

I have set up my Drupal 7 site for private files in a directory above root (../private). I also set my filefield on my node type to upload the image files to that private directory. I have two user ...
0
votes
1answer
843 views

Why are all files (except index.php) being redirected to 'index.html'?

We have a Drupal 7 Drupal Commerce site that we've just moved to our virtual private apache server, however we're seeing very strange behaviour that's making the site not work. We're getting a ...
0
votes
0answers
549 views

Prevent spammers accessing my site by blocking their IP address

Story: I have my drupal site hosted in aws. Initially there were so many spam registrations occured. I prevented this completely by google recaptcha. By checking the recent logs in drupal I see the ...
2
votes
1answer
821 views

How to add image cache headers?

When doing SEO tests, we consistently seeing a message for cache headers on images. We were thinking of implementing but cannot find the appropriate way to test this as the x-cache still gives a MISS. ...
0
votes
2answers
1k views

RewriteRule causing internal redirect limit error

I am trying to server a static HTML site from /sites/default/files/staticsite and make it available via a subdomain. I'm hosting the site on Acquia Cloud, and their docs describe Maintaining a static ...
1
vote
1answer
898 views

Why is my .htaccess not working when uploaded to a Pantheon server?

My drupal site has a .htaccess file on which I am redirecting the page without changing the URL. It's working fine on local server & other servers but when I upload the files & databases to ...
-5
votes
3answers
866 views

Two sites on the same server don't work

I have a Drupal 8 site installed in a root directory(/var/www/html). I then installed another Drupal 8 site in another folder(/var/www/html/myFolder). The homepage is working fine. If I try to log ...
10
votes
6answers
3k views

Friendly error page to replace WSOD

This should be the easiest thing to do, but for some reason I just can't get it done. I'm trying to get a friendly static error page to replace nasty 500 scenarios. For now I'm just trying to ...
0
votes
0answers
40 views

rewrite for single PHP file

I'm asking in this forum because there are some specific Drupal 8 rules that might need to be applied. I am looking for the correct way to add .htaccess rules that allow for: domain.com/specific/ ...
1
vote
0answers
673 views

Restoring a database breaks clean URLs

I am using Drupal 7 and the Backup & Migrate module to restore (or import) a Drupal installation that works fine on a different computer. When I run the import process everything seems to work ...
0
votes
0answers
268 views

I can't log in into a MAMP multi-installation

I know this is probably something super simple, but it's one of those days... I have MAMP set up on my computer so that I can have several local Drupal installs. I have one in a folder called d7 and ...
1
vote
1answer
586 views

Porting a multi-site setup to local (MAMP) server

There seems to be plenty of tutorials about setting up a local multi-site installation, however, I cannot seem to find any information about porting a live multi-site to a local environment. ...
1
vote
2answers
2k views

D8 doesn't create .htaccess for private file system path

Following this guide: https://www.drupal.org/documentation/modules/file it says "When you specify the private directory in admin/config/media/file-system it will automatically create the sub-...
1
vote
0answers
508 views

Allow access to private files only to Drupal, rest all 'access denied'

I have a drupal 7 installation with PDF module on NGINX server. I have a PDF.js field configured in all of the content types, PDF uploads through this goes to private (I NEED this as private). pdf.js ...
0
votes
0answers
163 views

502 Bad Gateway nginx for a drupal sub-directory site install

I have a default drupal 8 site install and a sub directory site install. The second Drupal site was an after thought and had to be hosted on the default site url in a sub folder. both sites share the ...
0
votes
0answers
13 views

Moved Site Files and Set Up Domain/Apache, Can't Access Login Page

I had a Drupal 8.4 site working fine on my Digital Ocean server, accessed at http://serveripaddress/sitename/ - the site was in maintenance mode. I then set up my domain name on Google Domains, ...
0
votes
1answer
137 views

Install using Composer doesn't create .htaccess file

Followed instructions at (https://www.drupal.org/docs/develop/using-composer/using-composer-to-install-drupal-and-manage-dependencies) to install Drupal with Composer using the command: "composer ...
0
votes
1answer
47 views

HTTPS with and without www

I have drupal 8 based website implemented. global $base_url; is used in two different modules. Module-1: $content .= $base_url .'/user/role/1'; it gives the URL pattern as: https://www.example.com/...
3
votes
3answers
1k views

.htaccess https rewrite for single domain on multisite installation

I have a multisite installation with 2 sites running off separate domains. One of these sites needs to go through https:// while the the other can stick to http://. I also want all traffic to be ...
0
votes
0answers
23 views

Issue with installing theme via Admin Dashboard (.htaccess issue)

I am getting "Access denied. You are not authorized to access this page." at "/admin/appearance/install?token=..." (Only this page alone) while trying to install a custom theme. I am quiet certain ...
0
votes
0answers
59 views

Struggling with Clean URLs

I am in the process of upgrading an old Drupal 6 site to Drupal 8. I realize Drupal 6 is end of support but need to get the site working on my local Debian box, in order to work with it to get ...
0
votes
0answers
34 views

redirection in htaccess file

I'm working on Drupal7. I want to redirect all the URl's to external domain except some. Below rewrite I have added in .htaccess file and its working fine. RewriteCond %{REQUEST_URI} !/user.*$ ...
0
votes
1answer
447 views

mod_expires enabled and cache flush

I my apache I have mod_expires enabled. My htaccess contains: <IfModule mod_expires.c> # Enable expirations. ExpiresActive On # Cache all files for 2 weeks after access (A). ...
0
votes
3answers
568 views

Problem creating redirect from page with %20 [closed]

I've been researching the issue for hours and can't seem to find a working solution to this problem. I've created a redirect from /sites/default/files/OLB%20Registration%20Guide.pdf to /sites/default/...
1
vote
1answer
67 views

.htaccess rewrite doesn't work [closed]

I have custom module with page at /page wich expects $_GET['id'] to do it's job. Here's .htaccess rewrite rule that works on empty website RewriteRule category+/(.*)$ page.php?id=$1 [L] On Drupal ...
-1
votes
1answer
78 views

.htaccess not working in files folder to disable php files from executing in files folder

I have the following in my default/files/.htaccess file: SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 ...
-2
votes
1answer
27 views

How are clean URLs with 200 response codes being managed without doing a RewriteMap?

I would like to know how Drupal handles clean URLs without getting a redirection 302 response. When you have clean URLs enabled, the ?q=123 part of the link goes to /my-node-title and you don't get a ...
5
votes
3answers
7k views

How to prevent executing .php files in sites/default/files directory for nginx+php7.0-fpm?

URL to Drupal.org article Preventing execution of untrusted PHP By default .htaccess inside sites/default/files contains: <IfModule mod_php5.c> php_flag engine off </IfModule> Adding ...
3
votes
1answer
394 views

How can I point to a site in a not common directory path?

Normally when adding a new Drupal site I just put the sites root folder in /var/www/ and then edit the hosts file for that address and then edit the httpd.conf file to point to that site. The ...
0
votes
1answer
154 views

Handle file requests

I'd like to be able to intercept calls to files (.pdf for instance) in order to run some custom code before the user accesses/downloads the file, and add a cover page accordingly. From what I ...
0
votes
1answer
68 views

Where should I place .htaccess to take effect in a particular site?

We have an Apache web server that contains several Drupal 7 installations. Where should I place a .htaccess file in order for its contents to take effect on a particular website? I tried putting it ...
1
vote
2answers
3k views

Redirect all www addresses to non-www web addresses

How can I redirect all traffic from www.domain.com/page to domain.com/page? I need to disallow traffic to web addresses that include the www. The reason is that I have an SSL certificate that only ...
1
vote
1answer
1k views

Expiration date for static files

I don't understand the following: In Drupal 7's default .htaccess file the Apache module mod_expires is ordered to let files without a .php extension expire after two weeks. How is web development ...
0
votes
1answer
93 views

How do I add static html files to my Aegir install

I have Aegir install running on a rack space server. In addition to the Drupal sites I am running, I would also like to be able to create static websites and server them from the same server. What ...
4
votes
1answer
10k views

Adding .htaccess within httpd.conf correctly

I am looking for advice on the correct way to place my .htaccess settings within my httpd.conf. Here is the server httpd.conf with the htaccess placed within a directory as per most instructions I ...
-1
votes
4answers
563 views

Clean URLs on multisite; Clean URL test fails but unable to enable it

Clean URL test fails but unable to enable it. Here is my configuration files. I am able to access the page via example.com/admin/config/search/clean-urls as well as example.com/?q=admin/config/search/...
0
votes
1answer
1k views

Can I rename index.php?

I am going to replace the front page of a Drupal 6 site with a new index.php. How can I rename the Drupal 6 index.php (say, to drupal.php) and keep the Drupal site functions working? For example, I'd ...
0
votes
2answers
146 views

Rewrite rules for Development & Production Environments

I'm having trouble with the file path when I upload my development environment to the server. The problem is actually quite simple. Development is working on the root folder ( development.tld ) ...

1
2 3 4 5 6