Directory-level configuration file found mostly on Apache web servers

learn more… | top users | synonyms (1)

1
vote
1answer
23 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
14 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
9 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
25 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 ...
-1
votes
0answers
22 views

Redirect no subdomain to www on AWS ElasticBeanstalk EC2 nodes

Having a heck of a time trying to figure out why none of these rewrites work. All the rest do but I can't seem to get domain.com to redirect to www.domain.com. We have a wildcard certificate so if a ...
0
votes
0answers
13 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
13 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
1k views

Apache deflate ignores javascript

I have set up deflate in my htaccess. Everything works fine, except for some reason javascript files are being ignored. I tried every possible combination of AddOutputFilterByType DEFLATE with ...
-1
votes
1answer
27 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 ^(.*)$ ...
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
93 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 ...
0
votes
0answers
18 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
105 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
1answer
1k views

.htaccess not being loaded in Ubuntu 14.04 (Apache 2.4.7)

I'm trying to use the .htaccess file in Ubuntu 14.04 (Apache 2.4.7). Here is what my .htaccess looks like # 1 YEAR <FilesMatch "\.(ico|svg|woff|eot|ttf)$"> Header set Cache-Control ...
1
vote
0answers
28 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
27 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
2answers
1k views

Enable Cross Origin Scripting on Nginx from retina.js to load files from another URL?

Im running a retina image plugin along with W3 Cache for CDN support. W3 cache moves images to S3, but the JS file won't server the files from there due to the difference in URL (it goes from h ...
2
votes
1answer
3k views

How to exclude a sub-folder from HTaccess RewriteRule

I have WordPress installed in my root directory, for which a RewriteRule is in place. I need to password-protect a subfolder ("blue"), so I set the htaccess in that folder as such. Problem is that ...
0
votes
1answer
68 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
19 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 ...
4
votes
1answer
4k views

Error headers: ap_headers_output_filter() after putting cache header in htaccess file

Receiving error: [debug] mod_headers.c(663): headers: ap_headers_output_filter() after I included this within the htaccess file: # 6 DAYS <FilesMatch ...
-2
votes
0answers
18 views

Log all .htaccess/.htpasswd logins? [duplicate]

I'm wondering how I can view/log all usernames and passwords that are used to attempt to access my directory on that is protected by htaccess basic authorization. How can I set this up on an ...
0
votes
1answer
1k views

Apache .htaccess with mod_expires not working for certain directories

I have a Joomla site that I am trying to enable caching using mod_expires. I have the .htaccess in the root of the site and have added the options as found on the page ...
0
votes
2answers
18 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
23 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
16 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
votes
0answers
19 views

.htaccess rules are not accepting in my server

My server is configured with Apache + nginx as revers proxy. One of my customer is using MODx and he wish to secure his "manager" ( domain.com/manager )area. He have added the following rules in the ...
1
vote
0answers
37 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
9 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
14 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'. ...
0
votes
1answer
3k views

.htaccess Rewriting Tomcat Server

I am writing a website using Railo. My code is to be deployed on a Railo Server running on Tomcat, overlayed on a regular Apache+PHP server. I need to send all requests to ...
2
votes
3answers
34 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
39 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
22 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
11 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
53 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
25 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
31 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 ...
0
votes
1answer
24 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
378 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
43 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
17 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 ...
1
vote
1answer
20 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
36 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, ...
2
votes
1answer
88 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. ...