Questions tagged [.htaccess]
Use it for questions about the configuration file used from the Apache server, the .htaccess file.
297
questions
20
votes
4
answers
59k
views
How do I simply make the whole site use a secure connection? [closed]
In Drupal 7, I used the Secure login module to run the site on a secure connection, but it seems it doesn't revert back to http on logout. I would like to just run the whole site as https:// as a ...
10
votes
6
answers
4k
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 ...
7
votes
3
answers
11k
views
Redirect /user/login to HTTPS, all other requests to HTTP
I'm using Drupal 7. The login page for my users is located at /user/login, so the default login path. I need that page to be encrypted using SSL so people aren't transmitting their passwords in the ...
7
votes
3
answers
9k
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 ...
6
votes
2
answers
3k
views
Why did the Apache directive to handle a clean URL get changed?
I noticed that the clean URLs implementation has gotten more complicated in Drupal 7. Rather than RewriteRule ^(.*)$ index.php?q=$1 [L,QSA] used in Drupal 6, Drupal 7 .htaccess has simply RewriteRule ^...
6
votes
1
answer
3k
views
How to place Drupal_Security_Do_Not_Remove_See_SA_* into httpd.conf instead of .htaccess
I run several Drupal 7 installations on a dedicated server with CentOS 6.4 and Apache 2 (the package httpd-2.2.15-29.el6.centos.x86_64).
I wonder, how to properly configure the ...
5
votes
2
answers
1k
views
How can I increase memory_limit for batch processes only?
I have a batch process that occasionally exceeds the memory_limit, which is currently 96M. Of course I know the ways to increase the memory limit for the whole site, but I prefer to increase the ...
5
votes
1
answer
766
views
Bypassing Drupal's htaccess rewrite for static page
I've created a site that is currently partly static while partly managed in Drupal.
I've managed to rewrite static HTML by specifying the /static directory in the following manner above Drupal's ....
4
votes
1
answer
11k
views
How to modify .htaccess to serve brotli compressed static assets over gziped ones?
I'm trying to use brotli compressed static assets with Advanced CSS/JS Aggregation as detailed here, https://www.drupal.org/node/2773807. The assets are created as they should be, but they're never ...
4
votes
3
answers
1k
views
How do I make ugly URLs such as "/index.php?main_page=about_us"?
I'm converting a Zen Cart site to Ubercart and need to keep Zen Cart’s ugly URLs for SEO purposes. The site is top ranking on Google Search for their keywords and I’ve been advised that changing the ...
4
votes
1
answer
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 ...
4
votes
2
answers
399
views
Clean URLs with multi-site only with suffixes / sub-folders
In D7 Multisite, I'd like to use clean URLs. However, these sites share the same domain but have different folder names.
For example, the login pages would are currently
https://domain.ext/red/?q=...
4
votes
2
answers
7k
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 ...
4
votes
3
answers
6k
views
Drupal 8: Multi-sites in subdirectories not working
I followed this tutorial(Drupal 7) but it not worked for me(Drupal 8):
Multi-site in subdirectories
https://www.drupal.org/docs/7/multisite-drupal/multi-site-in-subdirectories
This is my enviroment:
...
4
votes
0
answers
452
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 ...
4
votes
1
answer
111
views
Routing to production and testing Drupal installations on shared hosting account
I am having issues with routing users to different domains on a shared hosting account. Each of these domains are separate Drupal installations with separate databases. site is intended to be the ...
3
votes
3
answers
10k
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 ...
3
votes
2
answers
4k
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-...
3
votes
2
answers
1k
views
Create a general rewrite rule in .htaccess [closed]
In an upgrade scenario I have to provide some alias URLs like www.server.com/reading_23.html that should actually deliver www.server.com/reading/23.
I spent lots of hours trying to make that work by ...
3
votes
1
answer
9k
views
Some images are not displayed in IE [closed]
Some images fails to load on IE.
DOM7009: Unable to decode image at URL: '[some unique url]'.
The URL are set to sites/default/files/styles/image/image_name.jpg?itok=RANDTOKEN
I can fix the error ...
3
votes
2
answers
5k
views
Clean URLs not working, I can't log in to Admin Panel
I just moved my drupal website to another host. But I am unable to login as mysite.com/user. It gives me a 404 not found error which means clean urls are not working afaik.
So, I checked PHP ...
3
votes
2
answers
7k
views
Rewrite URL not working
In Drupal 6 I used the following snippet of code in my .htaccess file to extract information from a non-existent URL and pass it to an existing URL in a GET form. However, it isn't rewriting the URL ...
3
votes
1
answer
993
views
How does Drupal handle non Drupal sub directories?
I have a question about how Drupal handles requests made to subdirectories of the Drupal root that aren't under Drupal control.
What I mean is lets say I have a Site directory as such:
My main site
...
3
votes
2
answers
512
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 ...
3
votes
2
answers
271
views
unwanted site name in url
I've just copied my drupal website from local to server, everything is fine except the url of the site is http://www.mydrupalsite.com/mydrupalsite.com/index.php (although there is no folder named ...
3
votes
2
answers
2k
views
Drupal Redirect User Login Page
Basically I need to redirect this page
http://website/?q=user
to
https://website/?q=user
I tried adding a redirect rule to the .htaccess file in /var/www/html/ but that didn't work. From what I ...
3
votes
1
answer
395
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 ...
3
votes
3
answers
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 ...
3
votes
3
answers
18k
views
.htaccess: Options not allowed here
I just moved a new drupal site onto a directory '/drupal_test' under my current site. So that I can test it while my current site is still running.
When I go to the directory www.mysite.com/...
3
votes
2
answers
4k
views
Removing /Drupal from the URL-path [closed]
I know this question has been asked many times for the past versions of Drupal, but none of the solutions I've found works for Drupal 7.12.
I used to have an .htaccess file placed inside the document ...
3
votes
0
answers
528
views
Redirect whole site to HTTPS, with exceptions
I've successfully redirected my entire Drupal 7 site to HTTPS using the snippet:
RewriteCond %{HTTPS} off
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{...
3
votes
1
answer
319
views
Need to change the subdomain URL structure - D7
Need to change the subdomain URL structure from:
sub1.example.com
sub2.example.com
To:
www.example.com/sub1
www.example.com/sub2
Is there any module to do this in Drupal 7
If there is no other ...
2
votes
2
answers
1k
views
How to set up Drupal 7 on Apache/2 without .htaccess files ?
I would like to improve Drupal 7 and overall server performance by setting apache/2 without .htaccess files. How to configure apache/2 httpd.conf to achieve this?
2
votes
2
answers
753
views
I deleted my .htaccess. easy way to fix this?
I'm clueless enough that I managed to delete my .htaccess file from my drupal site (after some mistaked advice from my webhost tech support).
Now, I can go to the home page, but links to all internal ...
2
votes
3
answers
2k
views
problem with .htaccess file
I am getting the following error after uploading files in server:
The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there was an ...
2
votes
5
answers
738
views
What is good way to hide update.php file?
I will like to know what is the correct/better way to hide update.php file on the production server.
Currently when you try to access update.php file, Drupal shows default access denied page with ...
2
votes
2
answers
266
views
how to stop annoymous users to login in drupal
In wordpress, I have been disabling unknown people from accessing my wp-login.php using a script in the .htaccess.
RewriteCond %{REMOTE_ADDR} !^154\.70\.159\.2
RewriteRule ^wp-(login|register)\.php ...
2
votes
2
answers
1k
views
My server ignores the .htaccess file [closed]
I have a terrible problem: I have written rubbish within the .htaccess file, in order to break my web site, and cause an error 500. Result: nothing, nothing happens, the web site continues to be ...
2
votes
1
answer
6k
views
Why are URLs with non-existing subdomains not triggering an error 404?
One of my websites ignores random subdomains. The site doesn't have any subdomains but it will happily accept URLs such as fjiddifjdskdjf.example.com or dsfkljsdflsdjfds.example.com.
In both cases, it ...
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 ...
2
votes
1
answer
1k
views
After migration, impossible to logging from the remote server, error 'You are not authorized to access this page"
(Drupal 8)
From my local environment, I haven't any problem about logging with the admin user.
But after a migration from my local to my remote server, when I log with any user (and admin), I'm ...
2
votes
2
answers
3k
views
http to https htaccess always redirecting to home page
I have found following .htaccess code on stackoverflow.com to convert the http requests to https
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R,L]
...
2
votes
1
answer
4k
views
Only front page works
I am trying to set up a local server to try out drupal 8.1.3 and so far I was able to set up my profile and website but I cannot go to any pages other than the first page. (Welcome page, front page)
...
2
votes
2
answers
323
views
Rdirected site folder doesn't work
My web host directs traffic to the main public_html folder on the site for my main site. However, I want my main site to redirect to a subfolder for organizational reasons, so I can easily manage just ...
2
votes
1
answer
1k
views
The connection to the server was reset after trying to log as admin to Drupal
I did upgrade on Drupal 7 and imported these sites and database from localhost to another server. On localhost everything works well, on the server I can´t log to Drupal as admin. After entering ...
2
votes
3
answers
440
views
How can I make special non-Drupal URLs without file extensions?
As I understand it, Drupal is supposed to check the web root for any URLs it doesn't recognize, to see if it's a non-Drupal file on disk. Also, Apache is supposed to assume that anything without a ...
2
votes
1
answer
4k
views
Drupal 7 .htaccess redirects
I'm trying to redirect some old urls to the new Drupal ones with .htaccess rules.
This works
Redirect 301 /oldurl http://mysite.com/new-url
But this gives me a Drupal error
Redirect /people/...
2
votes
3
answers
2k
views
Drupal does rewrite url but can't load css/themes
I have an url rewriting issue with my drupal 7
I'm trying to rewrite for example index.php?q=categorie&categorie=laars to categorie/laars.html
So I downloaded the default drupal 7 .htaccess file ...
2
votes
1
answer
299
views
Url mapping from custom CMS to Drupal
We migrated a site from custom CMS to Drupal. The content has been migrated successfully, but there is a problem with URL mapping.
In old site the URLs were like domain.com/artists/Artist_ID/...
2
votes
1
answer
3k
views
Drupal install in sub folder
I am trying to install a drupal site that I built a while back. I put it in a sub folder for viewing purposes and am having trouble logging in. I got the site installed, the DB connected but when I go ...