Directory-level configuration file found mostly on Apache web servers

learn more… | top users | synonyms (1)

2
votes
0answers
9 views

Move htaccess rules to apache configuration files

I'm running a website with Joomla on a dedicated server (Debian), and i've read that moving .htaccess rules to apache2 configuration files may result in a good performance improvement (Apache HTTP ...
0
votes
1answer
63 views

Apache access control — from allow/deny to require

I'm trying to move my Apache access control directives from the older Order, Allow, and Deny to the newer Require. Unfortunately, I'm unable to think a new way after having used the old way for so ...
0
votes
0answers
22 views

How to make a 301 Redirect before proxy?

I have apache in front of tomcat. I have this proxy settings: <IfModule mod_proxy.c> <Proxy *> Allow from 127.0.0.1 </Proxy> ProxyPreserveHost On ProxyPassMatch ^/(.+\.cf[cm])(/.*)?$...
0
votes
0answers
15 views

How HTACCESS redirect using URL id content number range

I want redirect on range id content to a subdomain. For example: From id = 1 to 500 i want redirect to a subdomain oldcontent.example.com From id = 501 to 1000 i want redirect to a subdomain ...
0
votes
1answer
30 views

.htaccess file permissions changed

I have a weird problem on some of my servers with Directadmin and Wordpress installed. The file permissions of the .htaccess file are set to 444. When I change them back to 644, edit the file and save ...
2
votes
3answers
1k views

Server remembering old rewrite rules, even when I remove htaccess

I have set up a development server with Ubuntu and LAMP, but for some reason the .htaccess is acting strange... There is a site on there with a set of rules, when I comment them out they still work, ...
0
votes
2answers
47 views

How to disable the automatic redirection in WordPress-htaccess-file

WordPress has a function in its htaccess-file which performs an automatic redirection if the filenames match with an existing source. For example if you type in http://rechnen-in-der-wolke.net/...
0
votes
0answers
9 views

Apache not following RewriteRule for a symlinked dir

If I have a bad symlink as such: $ mkdir newmedia $ ln -s newmedia media $ rmdir newmedia So now media\ is a broken link My .htaccess has RewriteRule '^media.*$' https://www.google.com [R=301,L] ...
-1
votes
1answer
24 views

Override Apache method access settings

My website located at hosting server with Apache2/PHP5. When I published my site i found that on some server returns 403 Forbidden. I found that this error appears on request with method PUT and ...
0
votes
2answers
684 views

Prevent server beeing flooded with requests

I'm hosting a Wordpress-blog on an Apache server (shared hosting). For some reasons I've been receiving like 100 requests per second to xmlrpc.php for a few days. The access.log looks like this: ... ...
0
votes
2answers
5k views

htaccess redirect HTTP & HTTPS non-www to HTTPS www

How can I redirect my website from all HTTP requests to HTTPS + non-www HTTPS to HTTPS with www.? Example: Redirect HTTP non-www, HTTP www. & HTTPS non-www: HTTP:// example.com/ && HTTP:...
1
vote
1answer
40 views

.htaccess 301 redirect does not work

I have a website using PHP-based CMS system. So each page is generated dynamically, like this : http://www.shuling.net.cn/index.php?_m=mod_product&_a=view&p_id=87 Now I want to redirect ...
1
vote
1answer
27 views

301 redirect custom link

I have few thousands link like this /Gallery?cmd=viewCarGallery&carID=3747&pgID=1 Now I want to redirect them using .htaccess to another site to others link. Every will link will be ...
0
votes
0answers
10 views

HTTP to HTTPS redirect not working on internal pages [duplicate]

I am using this code to redirect HTTP to HTTPS and non www to www but not working on internal pages. Only homepage is working. <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / ...
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 ...
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 ...
-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
3answers
2k views

How to allow only specific directories to use htaccess?

Currently in apache2.conf I have AllowOverride all set for /var/www which simply allows htaccess for all the sites on the server (which is Ubuntu, 9.04). However, I'd rather only allow overrides in ...
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
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
1answer
128 views

Can I use nested <If> directives in .htaccess in Apache 2.4

I am trying to simulate the permalink structure of a previous version of my site using Redirect and RedirectMatch rules in my .htaccess file. I have different rules that I would to apply to different ...
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 ...
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
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 ...
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 ...
1
vote
0answers
214 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
2answers
6k views

.htaccess - redirect non www to www and retain subdomains from redirecting [duplicate]

So, on my main domain 'domain.com' I created several subdomains from cPanel, like 'sub1.domain.com' and 'sub2.domain.com'. Their real location on server is in 'domain.com/sub1' and 'domain.com/sub2'. ...
2
votes
3answers
39 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
1answer
3k views

how to sort apache directory listing in last modified order

# SET DISPLAY ORDER IndexOrderDefault Descending Name the above value is used to sort directory listing in decending name value how can i create the similiar results for sorting the directory in ...
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 ...
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
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 ...
1
vote
2answers
1k views

Server, Database or Code Issue? Magento backend rewrites itself with a index.php which doesnt work

I will be honest and admit my cross posting in magento.stackexchange.com but the reason is that I believe it is a server fault, and now I am looking for proof to present to my dreaded hosting ...
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....