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
-1 votes
2 answers
104 views

.htaccess file under sites/default/files/ stops css from loading

I'm working on a new installation of Drupal 10.2 and I noticed there's an .htaccess file in the files folder. This file is created automatically by Drupal. When I try to delete it, it gets created ...
Yusef A's user avatar
0 votes
1 answer
38 views

I can't access the login page

I have a backup of a site built with Drupal 7.60. I was able to complete the installation on my local machine, but I could not access http://localhost/showbizz-plaza/?q=user nor http://localhost/...
lance2k's user avatar
  • 101
0 votes
1 answer
98 views

Website doesn't load properly from htdocs/web

Built a website on localhost, moved it to shared-hosting where webroot is htdocs but when visiting the website through the hosting's given IP address it obviously doesn't load the website, because the ...
user3108268's user avatar
1 vote
0 answers
178 views

RewriteBase and Administer software updates permission not working

User 1 is unable to run /update.php, with the error: In order to run update.php you need to either have "Administer software updates" permission or have set $settings['update_free_access'] ...
ice70's user avatar
  • 131
0 votes
1 answer
270 views

How can I add custom code to Drupals .htaccess and make sure it will stay there [duplicate]

For one of my Drupal 9 website I need to add a custom code to the htaccess file to redirect the visitors from one subdomain to another for this I use the following code: #Custom Rewrite Rule ...
Joost's user avatar
  • 1,338
1 vote
0 answers
149 views

How does SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006 work exactly?

I ran into an issue (When using fpm, it is not clear how to make image styles work ) which I traced back to the use of Drupal_Security_Do_Not_Remove_See_SA_2006_006 in sites/default/files/.htaccess. ...
alberto56's user avatar
  • 214
0 votes
1 answer
25 views

Actual file permisions

With Drupal 8/9 I want to: Have a private file folder Upload files to it (ideally by whatever method but media type will do) Allow only authenticated users (ideally set by role) to view the file (...
tanbog's user avatar
  • 1,263
1 vote
1 answer
2k views

('text/plain') is not a supported stylesheet MIME type

We just upgraded from Drupal 8 to Drupal 9, and now we have some css files not working in Chrome due to the below error. Refused to apply style from '' because its MIME type ('text/plain') is not a ...
gary69's user avatar
  • 113
3 votes
2 answers
799 views

What is the proper process to customize htaccess files?

We have custom redirect links that use the RedirectMatch rules that redirect based on a root path. We'd rather handle these at the web server level rather than using the Redirect module (if it can ...
shelane's user avatar
  • 511
1 vote
1 answer
934 views

How do I avoid overwriting the .htaccess file when I use the Compose command?

On my new Drupal 9 website, I customized the .htaccess file and the robots.txt file I don't want its files to be overwritten when updating with Composer. I added the lines below in my composer.json ...
mathieu's user avatar
  • 25
0 votes
0 answers
708 views

Redirect to web folder

I'm trying to configure redirects on a Drupal site using Apache web server. I'm trying to implement what described in Remove /web part from a Composer based Drupal site, but I cannot get it to work. I ...
gary69's user avatar
  • 113
0 votes
1 answer
449 views

How to restrict access to specific php file to only athenticated users

I manually made a php file that has the ability to connect to the database and create table entries, it works fine, but now the problem is that if I leave it there, anyone will be able to access it to ...
julianx2rl's user avatar
0 votes
1 answer
321 views

Patching docroot htaccess: file not found

I tried to create my first patch file in order to reverse the overwriting of the scaffold file .htaccess after executing composer install. I get the following errors: can't find file to patch at input ...
0711master's user avatar
0 votes
0 answers
127 views

Conditional .htaccess rule for multisite sitemap.xml

We have multiple sites hosted with Domain access module. I was planning to host sitemap.xml files like web_root/zyx.com/sitemap.xml and web_root/abc.com/sitemap.xml. I am using the following code. ...
werqious's user avatar
  • 750
1 vote
1 answer
605 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. ...
Georgina Smith's user avatar
0 votes
0 answers
63 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/ ...
lms_forever's user avatar
1 vote
1 answer
887 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 ...
Jim's user avatar
  • 13
0 votes
1 answer
433 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/...
DrupBha's user avatar
  • 19
0 votes
0 answers
31 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 ...
Sonny's user avatar
  • 3
0 votes
0 answers
71 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 ...
user2007920's user avatar
0 votes
1 answer
290 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.*$ ...
JaSiMi's user avatar
  • 63
1 vote
1 answer
193 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 ...
Den's user avatar
  • 47
-1 votes
1 answer
175 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 ...
Patoshi パトシ's user avatar
-2 votes
1 answer
36 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 ...
Rosamunda's user avatar
  • 1,289
0 votes
0 answers
928 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 ...
Lloyd_07's user avatar
-3 votes
1 answer
47 views

Rewriting the page path from /my-drupal-project/docroot/user/login to /project/user/login using Drupal 8/Thunder? [closed]

I'm helping someone write some ReWriteRules for their Drupal project, but the expected behaviour for: ReWriteRule ^my-project/(.*)$ /my-drupal-project/docroot/$1 isn't happening - there seem to be ...
Tony Merryfield's user avatar
1 vote
1 answer
870 views

How do I allow custom .php files to be accessable?

I have already looked at the How do I call legacy PHP files? answers and they didn't fix my problem. I have a custom php file in my Drupal site (Hosted on Acquia Cloud and I am working on a local ...
Eluchel's user avatar
  • 387
0 votes
1 answer
763 views

Why/How I could remove index.php in the URL

I have added a RewriteRule to force https on one domain at the end of my .htaccess file RewriteCond %{HTTP_HOST} ^www.mydomain\.be [NC] RewriteCond %{HTTPS} off RewriteRule ^(.*)$ https://%{HTTP_HOST}...
Baud's user avatar
  • 532
0 votes
0 answers
151 views

Connection timeout when using backup module

Currently running Drupal 7.65. Trying to update to 7.67 due to the security update. I've been trying to run the backup & migrate module to back-up my site, but even when doing partial back-ups (...
josh's user avatar
  • 101
0 votes
1 answer
271 views

RewriteBase /folder issues on IIS for broken images

I have a Drupal 7 site hosted under a subdirectory say http://example.com/drupal. I am using IIS and SQLSRV. But all the images could not be loaded on the site as these images pointing to http://...
Umesh Patil's user avatar
-2 votes
1 answer
35 views

.htacces file setings for Drupal and other site folder in same host

Primary Domain Examle.com is on CMS Drupal 8. I must to share host with other site on different CMS location /public_html/othersite.com. What must I change in .htacces to have access to othersite....
user92105's user avatar
1 vote
0 answers
43 views

Multiple sites in same subfolder

I have multiple very similar drupal sites (each for a specific year of some project): 2012.somain.tld, 2013.domain.tld, etc. Their files are organized in subdirectories (2012, 2013, etc.) of ...
Danil Fedorovykh's user avatar
1 vote
1 answer
657 views

.htaccess error on local site in docksal

I've built a Drupal 8.6.4 website within Acquia Dev Desktop, but moved it into a local Docker/Docksal setup to continue working (haven't used it before) - on a mac, if it matters. Everything seems ...
turpentyne's user avatar
0 votes
1 answer
773 views

Remove index.php from imported urls

I made some migration of pretty old website to d8. And urls ported fine from latest WP version: /user1/article-name1 /user2/2009/article-about-something /user3/2017/11/06/article-something But from ...
betarobot's user avatar
2 votes
1 answer
996 views

Serving Drupal from within a sub-directory of my web root

I need my Drupal 8 website to be served from within a subdirectory of my NGINX_SERVER_ROOT but is doesn't work. Drupal should be reached at mydomain.com/drupal. My NGINX_SERVER_ROOT is /var/www/...
MrUpsidown's user avatar
1 vote
1 answer
10k views

htaccess for Angular app in a subfolder

I have an Angular 6 app living in a subfolder on a D8 installation. I have no issues navigating to the app and the angular routing doing it's thing as I navigate the app. My issues is I get a Drupal ...
Brad O's user avatar
  • 129
1 vote
1 answer
502 views

Google Page Speed Insights recommends Leverage browser caching

Google complains on leverage browser caching on the following files: Leverage browser caching for the following cacheable resources: https://www.googletagmanager.com/gtm.js?id=GTM-xxxxxx (15 minutes) ...
albertski's user avatar
  • 3,457
0 votes
1 answer
138 views

Can't load font woff

I have relatively simple issue but I can't fix it myself. My log is full warning with same message: page not found http://mywebsite.com/sites/all/themes/bigwig/font/entypo-icon-font.woff I have ...
Dmytro Pastovenskyi's user avatar
2 votes
2 answers
5k 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 ...
Joehoe's user avatar
  • 336
-5 votes
3 answers
1k 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 ...
Sarath Kumar's user avatar
2 votes
1 answer
466 views

Forced HTTPS not working on Home Page [duplicate]

I'm using HTACCESS to force all my pages to redirect to the HTTPS version. However the home page is still able to go to the HTTP version. I tried 2 examples from this post: How to simply make the ...
paper_robots's user avatar
-1 votes
1 answer
399 views

How to redirect custom login & register url to node? [closed]

I have changed below url's to Login & registration instead of default So URL will be http://www.domain.com/en/login-user http://www.domain.com/en/register-user I have multiple language so added ...
Test's user avatar
  • 19
0 votes
3 answers
1k 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/...
Jillian Hoenig's user avatar
-1 votes
1 answer
934 views

Why isn't my .htaccess masking my drupal subdirectory?

I've got D8 installed in a subdirectory example.com/drupal, but I don't want "drupal" to appear in any of the URLs. I've added the following to my example.com/.htaccess file: RewriteEngine On ...
the_meter413's user avatar
2 votes
0 answers
601 views

Image styles not generating when an unrelated htaccess rule is active

Having a very bizarre problem on Drupal 8.4.4. I have a custom module which accepts an image through a POST request and saves it as the submitting user's profile picture. This module has been in ...
saramm1's user avatar
  • 727
1 vote
1 answer
473 views

Locked out of the site, and new users can't get in

I have an odd problem. My new Drupal 8 site is a distro, purchased from ThemeForest. After installing it, I thought I created a new user correctly but maybe the name had disallowed characters. In any ...
P Tocco's user avatar
  • 93
0 votes
0 answers
61 views

Use sub-directory if URL includes specific string

I am using Drupal 7. Right now, I would like to install WordPress in a sub-directory for maintaining my content page. Since I've used my website for a while, I don't want to change my URL for SEO ...
jmu's user avatar
  • 290
0 votes
2 answers
2k 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 ...
Andrew's user avatar
  • 302
-1 votes
1 answer
224 views

Access to folder files without redirect to drupal index [duplicate]

I need to access a folder of my project. My project is at the root of my domain, and it is a Drupal (so the .htaccess redirects all traffic to the Drupal index.php). I need to access my resource /...
Javier's user avatar
  • 111
2 votes
0 answers
396 views

Adding protection against hotlinking to .htaccess breaks generation of styled images

Drupal 8.3.4, Apache, Image Magick toolkit (via Imagick module). I recently discovered some annoying hotlinking to my site siphoning my bandwidth and decided to disable it. Added the following to /...
Marassa's user avatar
  • 81

1
2 3 4 5 6