Directory-level configuration file found mostly on Apache web servers

learn more… | top users | synonyms (1)

0
votes
0answers
16 views

.htaccess losing to apache virtual host

I have a Drupal app at the default virtual host example.org running on Debian 8. I also have a separate application with a virtual host set to send requests for jones-store.example.org to another ...
0
votes
1answer
26 views

.htaccess php_value and php_flag being ignored in sub-directory

I have an .htaccess file in my public_html directory with the following rules: <IfModule litespeed> php_flag zlib.output_compression On php_value zlib.output_compression_level 2 php_value ...
0
votes
1answer
67 views

Redirect all the traffic from multiple domains to single domain using htaccess

I have hosted multiple websites on my server all sharing the same code base having one htaccess. I need something like this. if (domainname != example.com) redirect to example.com if there ...
-2
votes
1answer
52 views

Redirect IP to domain using SSL

I am trying to redirect my IP address to my domain which uses SSL. In my htaccess I am using following lines: RewriteCond %{HTTP_HOST} ^111\.111\.11\.111$ RewriteRule ^(.*)$ https://domain....
0
votes
2answers
331 views

Block request that is possible ddos

How would i best block a request that takes on the following form in the acces 104.154.55.118 - - [19/Apr/2016:06:33:57 +0000] "GET /werken-bij/onze-opdrachtgevers/senior-big-data-architect-open-...
0
votes
0answers
26 views

Apache vhosts redirect to www.domain.com:PortNumber/

I'm having the following problem with Apache 2.4. I have set httpd.conf file to listen to 2 more ports (8081 and 8082) like this: Listen 80 Listen 8081 Listen 8082 DocumentRoot "C:/xampp/htdocs1" &...
1
vote
0answers
56 views

Require all denied has no effect. Require all allowed, works

I have a website structure setup as follows, which I am trying to organize access levels for each but without specifying <Directory> as that requires the structure to be fixed (aka, if i copy ...
0
votes
1answer
31 views

How gzip compression still happening?

I am using Ubuntu 14.04.4 LTS,Apache/2.4.7 and PHP 5.5.9. I installed Wordpress 4.4.2 in my machine. When I run my site in localhost, I noticed that js/css are compressed in gzip format. I didn't ...
0
votes
1answer
194 views

How to prevent DOS attack on xmlrpc.php

We've been having trouble recently with a DOS attack on our main website, which is run using Apache httpd 2.2.9 and Drupal 6.35. The attack is a post to Dupal's xmlrpc.php, which is a known exploit ...
0
votes
0answers
9 views

Rename my hostname with htaccess? [duplicate]

When a user goes to domain1.com, i want my website to show domain2.com in the browser, how is this done in the .htaccess file? I tried the following, but no dice: AddDefaultCharset utf-8 ...
0
votes
1answer
20 views

.htaccess configuration to mask site?

I own a domain on godaddy (rainychat.com) and i have an app on Openshift (rainychat-jgal.rhcloud.com) Currently i have a forwarding rule on godaddy so when a user goes to rainychat.com it is ...
1
vote
1answer
17 views

File in the same subdirectory as the HTML in CMS

I have a CMS installation with a link such as journal.org/archives/volume136/number10/37362-49383 I want to place a few PDF files in the same directory as the above HTML such that the PDFs are ...
0
votes
2answers
19 views

One site handles https request with no ssl correctly, other generates \x16\x03\x01 error

We have two sites, sub.example1.com and example2.com. Neither one is specifically configured to handle ssl requests. One site https:/sub.example1.com, handles a secure request to port 443 successfully ...
0
votes
1answer
18 views

Incorrect document root being set up

I have set up two virtual hosts. The configuration file is as follows: <IfModule mod_ssl.c> <VirtualHost _default_:443> ServerName a.b.com ...
0
votes
1answer
26 views

Add line to all htaccess files in www directory

I am having some odd traffic to the xmlrpc.php files hosted by the wordpress sites on my server. Instead of opening each htaccess file to add a deny rule, is there an easy way to echo or insert the ...
1
vote
0answers
215 views

How do I allow users to override X-Frame-Options when using Apache + PHP-FPM?

I have an Ubuntu 14.04 server running Apache + PHP-FPM + FastCGI, serving user home pages. For security, I have enabled in Apache's configuration: Header set X-Content-Type-Options: "nosniff" Header ...
0
votes
1answer
11 views

Separating Redirects from .htaccess

I'm migrating my server to a different location. I have a bunch of changed URL's (50 or so) that I need to 301 redirect to new locations. I use Apache 2.4 Is there a way to separate them from ....
0
votes
0answers
20 views

“error establishing a database connection” On my wordpress website - with indexes problems?

I keep getting this: "error establishing a database connection" and this is not ending. This is /var/log/apache2/error.log: [Thu Mar 31 11:38:45.865505 2016] [autoindex:error] [pid 22782] [...
2
votes
3answers
40 views

How do I set up a toggle for an Apache RewriteRule?

I have the following Apache config, which displays a 503 Service Unavailable error to all visitors except for my IP address: ErrorDocument 503 /503.html RewriteEngine On RewriteCond %{REMOTE_ADDR} !^...
1
vote
1answer
61 views

How to expire image and force reload in Apache only when file in server changes

I have a PHP application running on an Apache2 server. I started off with HTML5 Boilerplate, and the .htaccess includes "1 month" expiry policy for all images. For example: ExpiresByType image/jpeg ...
1
vote
1answer
24 views

Avoid that subdomain gets redirected because of WWW canonicalization

I added this URL cnonicalization to my .htaccess file: RewriteEngine on RewriteCond %{HTTP_HOST} !^www.example.com [NC] RewriteRule ^/?(.*)$ http://www.example.com/$1 [L,R=301] But now my subdomain ...
0
votes
1answer
16 views

Serve media content only to logged in user using Apache

I recently saw this feature on another site where it would server media files, like uploaded images, only when the user is logged in. It would throw an "ACCESS DENIED" page otherwise. So, I ...
0
votes
0answers
65 views

rewrite works in htaccess but not in apache2.conf

I am trying to move rewrite rules from .htaccess to apache2.conf (at Kubuntu to use The Bug Genie software). Rewrite rules in .htaccess works fine, but after moving (and adjusting) it to apache2.conf ...
1
vote
1answer
27 views

order allow,deny blocks whole site

I can't get file blocking working. If I use the following statement in .htaccess, it blocks my whole site: order allow,deny <Files ~ ".*\.(js|JS|css|CSS|jpg|JPG|gif|GIF|png|PNG|mp4|MP4)$"> ...
0
votes
1answer
35 views

.htaccess is ignored even if rightly configured

I am getting mad: vhost: http://termbin.com/4z10 <VirtualHost *:8080> ServerAdmin istreaming@gmail.com ServerName ec2-52-36-220-163.us-west-2.compute.amazonaws.com DocumentRoot /var/...
0
votes
1answer
26 views

301 redirect non-www to www in subdirectories

I am in a unique situation where I have multiple instances of Joomla setup under my primary domain in different subdirectories. For example: example.com = Joomla instance example.com/subdirectory1 ...
0
votes
0answers
51 views

Ghost blog on subfolder under https in apache

I'm trying to serve ghost blog in a subfolder of my domain: mywebsite.com/blog (would be also good to serve it at blog.mywebiste.com) now, for the main website I've this configuration in apache (...
0
votes
0answers
31 views

Apache .htaccess give me a No input file specified

I known I'm asking about a well known problem, but I'm not a pro with LAMP stack and the answers I found doesn't fit my issue. This is my .htaccess file: RewriteEngine On RewriteRule myservices/user/(...
1
vote
0answers
1k views

htaccess: Is it possible to ask with rewritecond if the request was already redirect? [closed]

I'm having a redirect loop and it could be solved by asking with rewritecond if this is the first time since user request, or it's jumping already. Is it posibble to know inside .htaccess? Thanks in ...
1
vote
1answer
22 views

How to have an index.html and index.php together

I need to upload a file called index.html alongside my index.php (please don't ask why) Is there way to leave everything as it is and serve the index.html page only if they request it with its ...
0
votes
0answers
46 views

Case-insensitive fallback/redirect

I'm using some default images to show users the type of document that is used. e.g. this image to show there is a .png file In the /osr/icons/mime/ folder I have images for a multitude of files, e....
0
votes
1answer
48 views

how to redirect only one domain site

I have in my folder .htaccess which redirects all the sites to https. I want to only redirect awesomesites.com to https. Options +FollowSymlinks RewriteEngine On RewriteCond %{HTTPS} off RewriteRule ...
2
votes
1answer
97 views

mod_rewrite with multiple QUERY STRINGS

This is an extension to my question http://serverfault.com/a/761474/77231 I am trying to add an additional QUERY STRING parameter to the URL and change spaces to underscores but am having no success. ...
0
votes
0answers
10 views

Howto rewrite http://domain.com/~user to http://domain.com [duplicate]

I'm trying to create a mod_rewrite rule that says any links clicked on my website that refer to http://olddomain.com/~user instead go to http://domain.com - Is this possible?
-1
votes
1answer
49 views

Forcing HTTP to HTTPS causing 404 error

I have a website based on WordPress, and one section of it is built by external programmers (the backend). I was able to force all connections to go on HTTPS instead of HTTP using a plugin for the ...
1
vote
1answer
58 views

Apache redirect some url to homepage

I am trying to implement a simple rewrite, but looks like i am doing something wrong. What I am trying to do is that I have a url blog.example.com/articles/ which gives me 404 , and other urls are ...
0
votes
1answer
36 views

Redirect permanent vs RedirectMatch, which is better to enforce SSL security in Apache?

I have been using: RedirectMatch /(.*) https://www.website.com/$1 to enforce redirection from virtualhost 80 to 443 in apache. My reasoning is that it makes sense to grab anything that the user ...
0
votes
1answer
57 views

mod_rewrite to replace all dots with underscores after path

I've been through all tagged questions here and on SO, but my problem is different because of either/both needing to replace "." with "_" comes after a particular path and I'm running through a ...
0
votes
0answers
86 views

Apache htaccess config not working after upgrading from 2.2 to 2.4

Our document root is /var/www/foo.com/ and in /var/www/foo.com/lodging/ I have this .htaccess <IfModule mod_rewrite.c> RewriteEngine On RewriteBase /lodging/ # redirect base lookups to wp cms (...
0
votes
1answer
15 views

Is there an upper hierarchical limit to the .htaccess file placement using virtual hosts?

Question background: I have an Apache 2.4 virtual host environment hosting multiple websites in the following Ubuntu file hierarchy: /var/www/site-1-folder /var/www/site-2-folder /var/www/site-3-...
0
votes
0answers
6 views

htaccess rewrite incoming links to new one [duplicate]

I'm having a problem with site migration and old links. Now, its not just a server migration, it was also a CMS migration. Site went from umbraco (asp.net) to wordpress. Problem is that google indexed ...
0
votes
1answer
8 views

.htaccess rewrite exception directories

I need to redirect everything app/webroot because of sructure of cakePHP except 2 folders (beqr and becoupon) which are separate apps my .htaccess for now is: <IfModule mod_rewrite.c> ...
1
vote
2answers
66 views

htaccess: limit to only certain sub-domains

I have a wildcard ssl setup on Apache for a domain so that I can create any type of sub-domain on the fly. <VirtualHost *:443> DocumentRoot "/var/www/html" ServerName www.domain.com ServerAlias ...
0
votes
0answers
7 views

htaccess - Keep Domain but change subdomain

I've been trying around for ages now. I need to be able to redirect a call to a page to a specific subdomain of the same domain. Meaning, people are calling www.noodle.de, noodle.de or mysub.noodle....
0
votes
1answer
54 views

Wordpress .htaccess How to avoid redirect loops for images?

I'm configuring Redirects from a Html static website to Wordpress, I'm doing it manually in the .htaccess file and for some other rules I'm using Redirection plugin I have added these rules to my ....
0
votes
0answers
15 views

.htaccess Conditional based on MIME Type?

I know I can add a conditional based on the extension of the file being requested like so: <FilesMatch "\.(html|htm|php)$"> # blah blah blah </FilesMatch> But is there some way I ...
0
votes
0answers
32 views

Rewrite Query String to Display as Subdomain in Browser?

I have search every possible resource however, I have not been able to find the help i need so i thought i would ask here. I am not highly educated in .htaccess rewrites so please bare with me if i ...
0
votes
2answers
39 views

Testing htaccess for 500 server error without actual error

After reading some tutorials, I have created an error file, that should be displayed instead of 500 server error. I have added it to domain's root and added the following line to the bottom of ....
0
votes
1answer
60 views

Using htaccess to grant access to index file when user requests directory URL

I would like to use htaccess to allow access to the index file plus a few others in a directory (index.php) but require a user/pass for everything else in the directory. Right now I have: AuthName "...
0
votes
0answers
40 views

Htaccess redirect to https and www using a single RewriteRule

I have the following in my .htaccess file: RewriteCond %{HTTPS} off RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] RewriteCond %{HTTP_HOST} !^www\. RewriteRule .* https://www.%{HTTP_HOST}...