Tagged Questions

Directory-level configuration file found mostly on Apache web servers

learn more… | top users | synonyms (1)

0
votes
0answers
5 views

Redirecting permalinks and loading the same content

We're currently serving articles for a blog, with permalinks in this format: http://domain.com/articles/46 This is our current .htaccess content: # Permalinks RewriteEngine on # Articles ...
-5
votes
0answers
25 views

Subdirectory of a domain on a different server [on hold]

Hello Server Fault Folks, I have the following scenario: On one physical server, cocktailbuilder.com, I have a custom web application. On another physical server, let's call it X, I have a ...
-2
votes
0answers
22 views

can anybody assist with my rewrite rule not redirecting from https to http

can anybody explain me why this rewrite rule ( apache ifmodule ) does not work ? heres the code: RewriteCond %{HTTP_HOST} ^(www\.)?foo-center.eu$ [NC] RewriteCond %{HTTPS} on RewriteRule ^(.*)$ ...
0
votes
1answer
17 views

How to configure .htaccess to limit access for webpage?

I have website at phys_server1 (domain A) and payment.Gateway at phys_server2 (domain B). It is payment link (domainB/pay-here.php) at domainB (payment.Gateway). I have to open access to webpage ...
0
votes
0answers
7 views

Avoid redirect loop using htaccess or php

I have searched for my specific problem using google and your sites search engine, but found nothing similar to my task. I am rewriting via htaccess internally to point to the specific site content. ...
0
votes
1answer
17 views

How to redirect from ?page_id=… (apache)?

I have website at Wordpress. And it is webpage in Wordpress www.my-domain/?page_id=111 Now I need to create page outside of Wordpress (at the same server) and direct traffic to it instead of ...
0
votes
0answers
13 views

Set cookie domain and cookiless subdomain

Sounds simple, but I'm having problems with it. I tried the suggestions in many articles, but it doesn't work for me. I've created a subdomain, static.example.com, to serve my static files from it. ...
0
votes
0answers
26 views

htaccess rule on a js file

in my public folder I have a javascript file, data.js that is being called from various parts of my app. I want to add a .htaccess rules to that directory so that whenever data.js is called, the ...
0
votes
0answers
20 views

How do I 301 redirect - for all urls of my website to one single page

I have a website: www.example.pro with pages like: www.example.pro/contact-us/ and www.example.pro/about/ I want every URL from this website to redirect to: www.example.com Example: when opening ...
-1
votes
0answers
17 views

Mod Rewrite - translate querystring to actual html structure

Old PHP website using /?page=services or /?page=services&section=contact as its url structure. We have created a static file version of the site until we move to something like wordpress so the ...
-1
votes
1answer
27 views

Apache mod_rewrite to Nginx rewrite

I have a virtual private server with whm/cpanel. I have installed nginx_admin plugin. The plugin has created virtual host files (example.com, *.example.com and manage.example.com) In my old apache ...
-3
votes
1answer
27 views

htaccess infinite loop caused by redirect 301 [closed]

I am trying to create a simple redirect however it is saying that it is caught in a inifite loop any ideas what I am doing wrong. I am wanting all requests from the root to a sub folder called ...
0
votes
0answers
8 views

folder exclusion from redirect to mobile site

I plan to exclude a folder www.mysite.com/ca-eng/pages/storesection/ on my full website from mobile redirection and unfortunately I do not have access to .htaccess file. My service provider charge me ...
0
votes
0answers
19 views

Htaccess redirect all traffic https, except mobile. And rewrite to non-www [duplicate]

I'm trying to rewrite using htaccess all traffic over SSL (https). However my certificate gives an error on mobile, so I Want mobile traffic to go over the normal http protocol. This is my htaccess: ...
0
votes
1answer
39 views

Why Apache is delivering .htaccess files

I noticed my apache system is delivering .htaccess files although it shouldn't, due to: # The following lines prevent .htaccess and .htpasswd files from being # viewed by Web clients. # <Files ~ ...
0
votes
1answer
28 views

Forcing https redirect is rewriting all URLs to root directory and not appending latter half of URL

I'm forcing http to https with the following in .htaccess: ## Forcing https RewriteCond %{HTTPS} !^on$ RewriteRule (.*) https://website.com/$1 [R,L] Following that, I also have a redirect that ...
-1
votes
1answer
21 views

.htaccess redirection for alias domain [duplicate]

I have two domains named www.example.com and www.example-alias.com , Both domain are pointing same location in the server. I need to do 301 redirection for www.example.com to www.example-alias.com ...
0
votes
0answers
30 views

Regex validation : simple hotlink prevention while allowing search engines (and their localized versions)

I made and tested a simple hotlink prevention .htaccess and wanted to validate it here before putting it in production. <IfModule mod_setenvif.c> SetEnvIf Referer mysite\.com|localhost ...
1
vote
1answer
63 views

Apache2: Allow directory indexing, but restrict file access by type

I need to configure my Apache2 server (version 2.2.22) such that I allow auto-indexing of the WWW root folder and its sub-directories, but restrict access (i.e. restrict download) to just a set of ...
0
votes
0answers
17 views

.htcaccess RewriteRule without 301/302 error

I added the following Redirect-Rule to my .htaccess-file for my entire website: RewriteEngine On RewriteCond %{SCRIPT_FILENAME} !-d RewriteRule ^([^\.]+)$ $1.php [NC,L] Basically it redirects URLs ...
-1
votes
1answer
44 views

“Simple” .htaccess rewrite for sites in subfolders not working [duplicate]

I have a catch-all Apache virtual host in /var/www/. In it, I have a index.php that handles all the code for pages, and subfolders holding the resources for each site (images, css, etc). I want a ...
-1
votes
0answers
12 views

how to write Rewritemap in htaccess [duplicate]

Can any one please tell how to write Rewritemap in htaccess. i had tried the below code but it is not working. please tell me what mistake i am doing. <IfModule mod_rewrite.c> RewriteEngine On ...
1
vote
1answer
88 views

php htaccess environment variables php-fpm mod_proxy_fcgi apache 2.4

My .htaccess: SetEnv tvar "my value" RewriteEngine on RewriteRule .* - [E=boostpath:normal] My virtual host settings: AllowOverride All Options FollowSymLinks Require all granted ...
-1
votes
0answers
11 views

removing ?reg=username does not go to the correct replicated URL [duplicate]

we have a replicated wordpress website with an affiliate plugin installed, the standard URL is domain/?reg=username. we have tried to remove the ?reg= using .htaccess file and become domain/username. ...
0
votes
0answers
31 views

.htaccess rules for accessing subdirectory as document root

I'm using Magento on a LAMP stack. I have my primary store/application accessible from the root directory (e.g. website.com/). I have created a custom form for processing 3rd party vouchers at ...
-1
votes
0answers
18 views

Forcing download file instead of show in browser [duplicate]

My "file_name.txt" is displayed instead of download. I have tried that <FilesMatch "\.(?i:txt)$"> ForceType application/octet-stream Header set Content-Disposition attachment ...
0
votes
1answer
32 views

301 Redirect Root and Only Root (“/”) from https to http

I have found several Q/As on how to redirect root only, how to redirect from https to http (using .htaccess). But there was no question that merged both. And this answer is too dirty: ...
0
votes
1answer
44 views

htaccess conditional redirect to https

So i'm trying to redirect to https all visitors except my internal networks 192.168.x and 10.x RewriteCond %{HTTPS} off RewriteCond %{REMOTE_ADDR} !=(192\.168\.$|10\.$) RewriteRule (.*) ...
0
votes
1answer
27 views

Restrict access to entire website except the homepage using .htacess

I have just put a website live, but I need to restrict access to everything except the homepage for users outside of my IP address. I would like to do this using .htaccess. So far I have come up ...
-3
votes
1answer
52 views

Ah, Domain Issues [closed]

I own http://www.sazook.com, and lately I have been fiddling on with the .htaccess file. I am using neq3's hosting services, and I had the .htaccess set to redirect to my own 404 page. Upon going to ...
0
votes
0answers
50 views

Apache Gzip not compressing js files

I have enabled Gzip compression via adding the below to my .htaccess file: <ifModule mod_gzip.c> mod_gzip_on Yes mod_gzip_dechunk Yes mod_gzip_item_include file .(html?|txt|css|js|php|pl)$ ...
-1
votes
1answer
41 views

Tomcat app behind Apache, htaccess auth

Please help to set up a protection for Tomcat app with .htaccess. I want to use mod_proxy ProxyPass and ProxyPassReverse My tomcat app: www.example.com:8085 What I want is to make it impossible to ...
0
votes
0answers
11 views

.htaccess not working inside a firewall or proxy

I have a test site running with an .htaccess file defined like so: AuthName "test" AuthUserFile "/home/testdomain/.htpasswds/public_html/passwd" AuthType Basic require valid-user This requires a ...
1
vote
1answer
138 views

Nginx rewite rules 403 error

I am having trouble with converting .htaccess files to nginx. I have 3 .htaccess files. The first .htaccess file is located in the document root and is as follows: Options +FollowSymLinks ...
0
votes
1answer
31 views

nginx .htaccess in two diffrent folders

I have a script that has 2 .htaccess files. The fist .htaccess file is in the root directory, and the second is in a folder under the root directory called upload. However, what I can not figure out ...
0
votes
0answers
16 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 ...
2
votes
3answers
71 views

nginx [emerg] unknown “0” variable

I've been trying for two days to convert an .htaccess to nginx rewrite the original file looked like this: # Turn on URL rewriting RewriteEngine On RewriteBase // # Protect hidden files from being ...
0
votes
1answer
56 views

RewriteRule not working properly in my ubuntu server 14.04 running in Windows Azure

In my server I kept signup.php and in htaccess I kept this thing - RewriteRule ^registration/$ signup.php [nc] However it's working fine in my Windows machine running Wamp. But not ...
0
votes
1answer
13 views

Alter RewriteRule to change parameter results

Here is my Apache 2 Directory configuration: <Directory /var/www/html/website/> Options +SymLinksIfOwnerMatch RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f ...
1
vote
1answer
118 views

htaccess redirect whole url as parameter

We have created an iframe loader index5.php which will show two iframes, iframe1 and iframe2. The content of iframe2 can be set by accessing index5.php?url=iframe2url. So, going to ...
0
votes
1answer
103 views

Configuring .htaccess on a site with a CodeIgniter app and traq issue tracker

I have this site running on CodeIgniter and I have installed traq for issue tracking. Under public_html I have my application and system directory as well as an assets directory, and also traq. i.e.: ...
0
votes
0answers
30 views

Cache-Control only working for media files and not static files served in Django

I'm trying to use Cache-Control for my static files. Following is my code for the .htaccess file # 1 YEAR <FilesMatch "\.(ico|svg|woff|eot|ttf)$"> Header set Cache-Control "max-age=31536000, ...
2
votes
1answer
136 views

Apache, htaccess, url rewrite

I have .htaccess file I'm using for testing, here is my file: RewriteEngine On RewriteCond %{REQUEST_URI} ^/([a-z-]+)/?$ [NC] RewriteRule ^ %{REQUEST_SCHEME}://%{SERVER_NAME}/?title=%1 [L] I'm ...
0
votes
1answer
290 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 ...
0
votes
1answer
12 views

static files from subdomain, fcgi from root

I would like to send requests for foo.com -> foo.com/dispatch.fcgi and requests for a subdomain bar.foo.com -> foo.com/bar I have this in my .htaccess file; AddHandler fcgid-script .fcgi ...
0
votes
2answers
46 views

SetEnvIfNoCase Host: .htaccess to web.config conversion

I have tried IIS Manager and some online conversion tools but I can't figure out how to achieve the following .htaccess rules in a web.config file: SetEnvIfNoCase Host my-domain.com nopassreq ...
0
votes
1answer
14 views

Lighttpd: How to migrate a rewrite rule?

i'm using this htaccess rule on a apache: RewriteEngine on RewriteCond %{HTTP_REFERER} example\.com [NC] RewriteRule .* - [F] .. and i would convert it to an lighttpd rewrite rule. How can i do ...
0
votes
1answer
194 views

.htaccess file causes “500 Internal Server Error” but no error log entry

I set up an apache manually and added a second web directory with this code: Alias /webs c:\webs <Directory /webs> AllowOverride All </Directory> However, this web has an .htaccess ...
-2
votes
1answer
69 views

Apache Redirect to another folder, both within and outside document root [closed]

I've recently set up a home web/media server and having a few difficulties with a few of the settings. It's working fine for serving webpages etc but I've now reorganised the structure of the main ...
0
votes
3answers
91 views

Deny connection to and from a specific hostname on Ubuntu/Apache2

My wordpress EC2 server was probably hacked. When running iftop command I can see that my server sends and recieves data from a hostname name "i157panamamails.com". This hostname never goes away and ...