Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [.htaccess]

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

0
votes
0answers
17 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 ...
1
vote
1answer
44 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 ...
0
votes
1answer
28 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 ...
1
vote
1answer
57 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/...
0
votes
1answer
195 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 ...
0
votes
0answers
20 views

Non-Drupal directories and content and language in URL

I have a non-drupal content and sub directories on same level of a Drupal project i.e: local_drupal_site/NON_DRUPAL_SITE where local_drupal_site is a Drupal project and NON_DRUPAL_SITE is PHP site ...
1
vote
1answer
178 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) ...
0
votes
1answer
23 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 ...
0
votes
0answers
67 views

Redirect to URL with trailing slash using .htaccess

I am trying to redirect url with no trailing slash to the same url with trailing slash by following .htaccess rewrite rules: RewriteEngine on RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f ...
1
vote
1answer
382 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 ...
-4
votes
3answers
440 views

Two Drupal 8 sites in a same server is not working

I have a Drupal 8 site installed in a root directory(/var/www/html). Then I installed another drupal 8 site in another folder(/var/www/html/myFolder). The homepage is working fine. If I try to login ...
2
votes
1answer
84 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 ...
1
vote
2answers
180 views

How to redirect custom login & register url to node?

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 ...
0
votes
2answers
132 views

Problem creating redirect from page with %20

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/...
0
votes
1answer
276 views

“Page not found” or “Forbidden” when submitting form Is it a problem with Apache?

I have some reseller hosting and I am running Drupal 7 sites on several different accounts there. I recently noticed a problem when updating one of them. It happens when I am editing content or ...
0
votes
0answers
35 views

Unable to block hotlinking

This is on an environment using Drupal 8.4.4, on CentOS Apache 2.4.6. I have two files, a pdf and an apk, sitting in sites/default/files that I would like to block external access to, and only allow ...
-1
votes
1answer
309 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 ...
0
votes
0answers
56 views

How do I mask my Drupal subfolder without affecting my subsites?

I'm running Drupal 8 multisite with one primary site at example.com and a subdomain at sub.example.com. Drupal is installed in /public_html/foo/example.com/drupal. The document root for example.com ...
1
vote
0answers
320 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 ...
1
vote
1answer
147 views

Locked out of Drupal 8 site, and new user 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 ...
0
votes
0answers
40 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 ...
0
votes
1answer
315 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
votes
1answer
78 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 /...
2
votes
0answers
207 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 /...
0
votes
1answer
113 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 ...
1
vote
0answers
222 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. ...
3
votes
0answers
221 views

Image styles are not generated in Docker for Windows

When I open in browser http://localhost:1567/sites/default/files/styles/thumbnail/public/2017-10/478069720_1384178114_4.jpg, I see 404. The "original" images are uploaded successfully, and the ...
1
vote
0answers
469 views

Running a site from a sub-directory of the web root [closed]

I have a shared hosting account that I would like to set up a Drupal 8 website on. However, been the primary domain for the hosting account, I cannot change the hosting directory where CPanel serves-...
0
votes
1answer
223 views

Cannot Login After Drupal 7 migration

Sorry, unrecognized username or password. Have you forgotten your password? The error above shows even though I have inputted correct credentials in my site(192.168.5.141/doc_monitor). Below are the ...
0
votes
1answer
304 views

Drupal in subdirectory: can't install modules

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
1answer
416 views

Configure web.config to redirect non-www requests to www for multi-site Drupal 7 Install

I have a multi-site Drupal 7 install running on Azure that I would like to force all non-www traffic to the www address for all sites. I have tried a number of examples from around the web but none ...
0
votes
1answer
20 views

Exclude the www- append to only one multisite

Stock Drupal 7 contains the following in the .htaccess file # To redirect all users to access the site WITH the 'www.' prefix, # (http://example.com/... will be redirected to http://www.example....
0
votes
1answer
127 views

Front page returns 403 for unauthorized users

I'm trying to get a D7 staging site's git repo up-to-date with its production server repo. In other words, I changed A LOT of stuff on staging (by running git fetch <branch> && git reset ...
0
votes
1answer
2k views

Too many redirects error with https and domain access module

I'm redirecting traffic for my various domains to HTTPS. Things seem to work fine on my local, but when I deploy to my production site I get the "www.mysite.cn redirected you too many times." error. I'...
1
vote
0answers
800 views

Restrict access to admin pages by IP from .htaccess [duplicate]

I am trying to lock down a Drupal 7 site so that only users on a certain range of IPs can login. I tried using the Restrict IP module to block the /user and ?q=user routes but this did not work. Is ...
4
votes
1answer
2k views

Index.php prompts to download instead of executing

I am running into a issue where I am trying to load up my Drupal site, but instead of going to the main page, it instead prompts to download / save the file. I know that my PHP is active and I can't ...
1
vote
1answer
580 views

Why are there .htaccess and php files in ./sites/default/php/twig

Just wondering, it may be related to cache settings, but why are there lots of php and .htaccess files in the public:// dir?
0
votes
1answer
37 views

best way to restrict endpoints such as /node or /filter/tips

I am looking for the best way to restrict access to drupal pages such as /node, /filter/tips and /filter/tips/plain_text etc. Do I add rewrite rules to the .htaccess file?
-1
votes
2answers
5k views

Where is the .htaccess file?

I have just installed a Drupal 8 website using drush dl drupal-8 --select. I have rewrite issues because there is no .htaccess in my root directory. Where can I find the default .htaccess file for ...
-1
votes
1answer
405 views

404 and 403 Errors after site migration

I have migrated a site from one server to another and the page just refuses to work. I have all modules enabled as on the old server, .htaccess is present in the root folder yet when i access the ...
1
vote
1answer
46 views

Search Engine returning multiple 404s, Redirect 404 urls based on node id in the url

I am using Drupal 7. Many of my url paths (up to 6,000) have moved to new url paths with no 301 redirect so they are returning lots of 404s on google. i have paths like /articles/bla/bla-bla/12345 ...
1
vote
2answers
586 views

Getting error 'The requested page could not be found' after https is enabled

The link to my content is lost default settings: # Set "protossl" to "s" if we were accessed via https://. This is used later # if you enable "www." stripping or enforcement, in order to ensure ...
0
votes
0answers
535 views

Migrated Site Access Denied at Login

I have just migrated a Drupal 8 site. Everything works, except for the login. When I submit the login form, I receive "Access Denied" page from the theme. Similarly, I get some SMTP module errors when ...
0
votes
1answer
121 views

.htaccess 301 redirects breaking clean URLs

I am trying to make a couple of (I think) very basic rewrite condition / rules in .htaccess. I placed them as the first rule after RewriteEngine on. Things seemed fine locally, and the rules appeared ...
1
vote
1answer
214 views

Domain Access and One.com hosting (funny subdomain rewrite)

I have a D7 installation that uses Domain Access to distinguish between a main website example.com and a minisite event.example.com. They share the same document root / Drupal installation and the ...
0
votes
0answers
786 views

How to make all URL redirect to HTTPS

There is already a lot of links displaying videos inside my site (in node content) that are using: http://example.com/clips/2017/01/11/51706, http://www.example.com/clips/2017/01/11/51706, https://...
5
votes
2answers
3k 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 ...
0
votes
0answers
89 views

How to get CLEAN URL's to work?

I have apache running and setup correctly. I have mod_rewrite on in both apache and in my .htaccess file, yet clean urls refuse to work for my site. How can I fix this issue??? My .htaccess file. # #...
1
vote
2answers
749 views

ERR_TOO_MANY_REDIRECTS on images after switch to HTTPS

I have the Drupal 8 site was working with HTTP on the port 80. I switched it to HTTPS with port 443. I got the problem for ERR_TOO_MANY_REDIRECTS when accessing some images from physicals path. For ...
0
votes
1answer
426 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 ...