Directory-level configuration file found mostly on Apache web servers

learn more… | top users | synonyms (1)

-2
votes
1answer
15 views

Equivalent of .htaccess in NGINX

I have the following .htaccess file. I am trying to configure this on NGINX with no luck. .htaccess RewriteEngine On RewriteCond $1 !^(index\.php|resources|robots\.txt) RewriteCond ...
1
vote
1answer
6 views

How can I force mod_rewrite to send user info component of a URI?

A colleague recommended I repost this from StackOverflow to ServerFault: This has been driving me crazy. I have a web application that's being served via Apache Web Server. The database server that ...
-1
votes
0answers
10 views

Why does my subdomain https traffic go to my primary domain? [on hold]

I've been trying to get this to work for about a month now on my shared hosting account. I have a wildcard SSL cert. I've tried a bunch of things I've found online. So far what I have below is the ...
0
votes
0answers
9 views

Can't redirect HTTP to HTTPS for subdirectory [duplicate]

The following code (in my root level .htaccess file) should redirect http://www.pillerdesigns.com/iwp/ to https://www.pillerdesigns.com/iwp/ (non-SSL to SSL): RewriteCond %{HTTPS} off RewriteCond $1 ...
1
vote
1answer
27 views

Redirect IP to a domain name using htaccess

Let's say I have this IP Address 11.12.13.14 and the domain example.com. Now what I want is to redirect the user from IP Address to domain name (but without changing the domain name to address bar). ...
1
vote
1answer
22 views

Apache security - list all possible handlers / actions

To ensure there aren't security weaknesses that can be exploited via .htaccess, how can we see all possible handlers that Apache can use via directives like SetHanlder and AddHandler. I know I can ...
0
votes
0answers
7 views

Set 1 cookie on 2 different subdomains

I am trying to get one cookie to work with 2 domains. Currently using an agreement page once a users first views the website that it will come up and they have to accept the ToS to continue, however ...
0
votes
2answers
953 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 ...
-1
votes
0answers
8 views

.htaccess block the css, img, js under the public folder

I'm facing a very weird situation that my website can load the img/css temporarily and running successfully, after a short while, it loss the connection to this public folder, which includes ...
0
votes
1answer
75 views

How to cache particular file in folder using .htaccess

i tried google and found one solution at 'http://webmasters.stackexchange.com/questions/24881/cache-a-particular-image-using-htaccess' but it cache all the file of folder, i want to cache only ...
-1
votes
1answer
15 views

how should I 301 redirect https address to http address?

I have recently moved my website to a new domain. The previous domain had SSL installed and it was https://example.com. My new domain is http://newexample.com and It doesn't have SSL on it. I used ...
0
votes
0answers
16 views

Combining .htaccess with http.conf to set https and direct all routes to index.php

I'm sure this question has been asked before, and I have tried to understand many of the answers given, however none of them seem to work with my particular set up. If the question can be answered ...
0
votes
0answers
16 views

404 Not Found or 500 internal server error using nginx try_files configuration

I'm trying to move my project from Apache to nginx. I use WT-NMP. I'm converting .htaccess to nginx configuration by adding this in nginx.conf. location / { try_files $uri $uri/ /index.php/$args; ...
1
vote
2answers
7k views

How to redirect example.com from HTTPS to HTTP, then HTTP example.com to newdomain.com?

As of now I use this rule (in .htaccess of example.com) to redirect HTTPS/HTTP example.com to newdomain.com: Options +FollowSymLinks RewriteEngine on RewriteRule (.*) http://newdomain.com/$1 ...
-1
votes
1answer
29 views

Laravel: default route will render but others will not. Ubuntu/14.04 / Apache2 configuration issues? Not sure what I am doing wrong

Laravel will render the default / root page normally. but will not render default routes or error pages. My web browser will return with Apache (NOT Laravel) error pages with I try and access /test ...
4
votes
1answer
3k 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 ...
-1
votes
0answers
30 views

User logged in can't access .php files [closed]

I'm using a Web server with xampp. I wrote a .htaccess to block access to the folder where my php files are. However, when a user is logged in my website, I can't access the php files. Is there any ...
0
votes
0answers
14 views

htaccess redirect with regular expression [duplicate]

Some redundant pages are being created in the website. Eg, archives/volume41/number21/calls- archives/volume52/number19/calls- archives/volume66/number7/calls- archives/volume70/calls- ...
0
votes
0answers
39 views

Apache Header Module Loaded but can't set headers in htaccess

I have Apache 2.2.29 (unix) setup and running on my new dev machine (mac). I am trying to set CORS headers for an API project - something that I have done many times. The htaccess file for the ...
4
votes
3answers
2k views

Does is matter in what order rules are placed in htaccess?

I hope this is a simple YES or NO answer (please specify why) Q1: Does is matter in what order the rules are placed in htaccess? Since they are completely separated items: for example Q2: If yes, am ...
0
votes
1answer
2k 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 ...
7
votes
2answers
17k views

How should I use the <If> directive in .htaccess?

I'm trying to add a conditional statement using Apache's If directive in my .htaccess file. I have referenced this page http://httpd.apache.org/docs/trunk/mod/core.html#if but it doesn't elaborate ...
0
votes
2answers
69 views

Setting Access-Control-Allow-Origin in .htaccess for Https protocol

I have a site with http and https. I set in the .htaccess the following line which runs for http. Header set Access-Control-Allow-Origin "*" But with https I get this error. No ...
0
votes
0answers
10 views

Apache2 as ReverseProxy Using htaccess; Limit acces to subdirectory with different user than to root folder

I have a WebApplication behind a Apache2.2, which is used as a reverse proxy. Now I want to limit access to the root folder of the application and to the subfolder docs. However I need different users ...
0
votes
3answers
2k views

Apache RewriteRule - Proxy flag not working

I'm having a problem running Apache 2.2.20 on a Linux Mint distro. I've got the following rule in my .htaccess file: RewriteEngine on RewriteRule old1/old2 http://localhost/new1 [P] When I browse ...
0
votes
0answers
103 views

mod_rewrite path info postfix and per-dir prefix

There's an issue with .htaccess configuration. I just need the url /category to match the category.php script, but when I try to open this url, there's a 404 error instead. Here's my .htaccess: ...
0
votes
1answer
47 views

htaccess - redirect non https & set different default page for each sub-domain [duplicate]

I have a wild card ssl for my domain. I have many subdomains each with its own default page. www.domain.com/main.html     [/home/domain/main.html] ...
0
votes
1answer
24 views

apache mod_rewrite rule not working [duplicate]

I'm testing the rule below else where and it's working but on my system it's not (centos 7, Apache/2.4.6) [I changed my domain to domain.com for the post here] the purpose of the rule is to rewrite ...
0
votes
1answer
25 views

filename repetition unwanted but from Apache 2.2 .htaccess RedirectPermanent

On Apache httpd 2.2, my .htaccess is failing when I RedirectPermanent to a file within a subdirectory, but it's fine if the destination file is at the website's root level or is the ...
0
votes
1answer
2k views

mod_expires doesn't set expiry for images (png,jpeg,gif)

I am using this below configuration in my apache2.conf <IfModule mod_expires.c> ExpiresActive On ExpiresByType image/gif "access plus 6 month" ExpiresByType image/jpg "access plus 6 ...
-1
votes
1answer
36 views

website uses an invalid security certificate

I have website on ubuntu with apache server. Domain is from godaddy. When I type example.com it's running file under SSL (with https). But, for www.example.com it's giving me below error. ...
5
votes
1answer
2k views

Apache sends plain-text response when accessing SSL-enabled site without HTTPS

I've never encountered something such as this before. I was attempting to simply redirect the page to the HTTPS version if it determined that HTTPS was off, but instead it's displaying an HTML page ...
-1
votes
0answers
25 views

Apache webserver configuration/access to only index.php

I'm trying to the below with Apache/2.4.6 (CentOS) webserver installed using yum. I've got my php pages served from /var/ww/html/project1 index.php is a symbolic link that points to a login page ...
0
votes
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 ...
-2
votes
1answer
25 views

htaccess without redirect HTTP & HTTPS non-www to HTTPS www

i have SEO problem for http to https and non-www to https://www Please help me how to solve this problem? this is my htaccess code: RewriteEngine On RewriteCond %{SERVER_PORT} 80 RewriteCond ...
1
vote
2answers
59 views

CentOS - Apache HTTPS not reading htaccess

I have been stuck with an issue with rewrite on apache on CentOS. If I load my site from HTTP, it works fine. Rewrite rules work. Once I change it to HTTPS, the rewrite rules don't work. After some ...
2
votes
1answer
925 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 ...
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
2answers
928 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 ...
0
votes
2answers
35 views

Apache access control not behaving as expected

I have a static HTML website that being served by Apache 2.4 using SSI. I have been using basic authentication to control access to a subset of files and it has stopped behaving as expected. ...
1
vote
1answer
676 views

Apache SSL redirect loop [duplicate]

We are trying to redirect our site from http to https only. Everything we have tried in .htaccess has resulted in a redirect loop. If we manually type the "https://" in front of the url, our page ...
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
1answer
130 views

how to remove .php extension using htaccess on godaddy linux hosting

How to remove .php extension using htaccess file. I have tried many codes (which I found on internet but not got success. An Internal server error is regularly showing. I am using Godaddy Linux ...
0
votes
1answer
18 views

Redirect all vhosts when a certain condition is true

I am trying to redirect all vhosts to a certain url based on the REQUEST_URI. For example if somebody makes a request to www.something.com/condition on my server to be redirected to google.com I ...
0
votes
0answers
23 views

Subdomain only read the index file

This is the structure of the directory: +example.com +public_html +assets //assets directory of example (css,js,img) -index.html //the index file for example +subdomain ...
10
votes
3answers
17k views

Configuring favicon with expires header in htaccess

I have implemented Expires headers via mod_expires on my Apache server and have successfully created expires headers for most file types, however I am having trouble with the favicon. I initially ...
0
votes
0answers
11 views

Exclude 1 file from htpasswd in httpd.conf [duplicate]

I'm running a development server that's currently protected by .htpasswd pre launch, it's setup okay but I've tried to un password protect 1 file http://thesite.com/roost_manifest.json in the public ...
0
votes
0answers
20 views

SetEnvIf Work on Local But Not on Live

I'm trying to set a variable MAGE_RUN_CODE for Magento in .htaccess depending on the domain name. I have the following on my local MAMP installation, and it is working as I'd like. I have two sites: ...
0
votes
0answers
32 views

Password protect folder and allow all subfolders (apache)

I'm trying to password protect one folder on my web site using an .htaccess file with an .htpasswd file. It works and I get it to password protect it. Can I add something to my folders .htaccess file ...
1
vote
1answer
28 views

Redirect Webmail traffic through port 80?

I have set up a website on BlueHost (shared server) and I have set up webmail in a subdirectory. But every time I use the url mywebsite.com/webmail, it gets rerouted to mywebsite.com:2095 which ...