Directory-level configuration file found mostly on Apache web servers

learn more… | top users | synonyms (1)

0
votes
1answer
15 views

apache tries to access .htaccess in lost+found directory

A subdirectory /var/www/vhost/servername/httpdocs/subdir/of an apache (ver. 2.2.22 on ubuntu 12.04) vhost webroot is a disk partition of its own. Accordingly, there is also ...
-2
votes
0answers
11 views

Either all Options must start with + or -, or no Option may

I have this line in a .htaccess file Options +SymLinksIfOwnerMatch ExecCGI Includes IncludesNOEXEC SymLinksIfOwnerMatch ExecCGI Includes IncludesNOEXEC SymLinksIfOwnerMatch ExecCGI Includes ...
0
votes
1answer
12 views

Ubuntu + Apache + .htaccess: Hide from Google

How do I edit the .htaccess file in the folder www/owncloud/ to set: X-Robots-Tag to "noindex, nofollow" (Using header rather than robots.txt according to: https://yoast.com/x-robots-tag-play/) Have ...
-3
votes
0answers
16 views

Redirecting an entire site to new one, some links still throw HTTP 500 error [on hold]

I'm moving an entire site off of a hosted shop to a WP/Woocommerce installation. I have gone ahead and 301'd the entire site to keep Google happy. However one link still throw HTTP 500 error. I'm not ...
-1
votes
0answers
14 views

Redirect subdirectory to folder out of path

I have a website(legacy code) that I am trying to decipher. On our home page the links point to /content/?page=x where page=x are the $_GET variables in content/index.php. The reason this doesn't ...
-1
votes
0answers
15 views

How to redirect server to server via .htaccess?

what i am trying to do is to shift my folder to another server. URL: Example: 1) example.com/xyz/folder1 or example.com/xyz/folder1/whatever 2) example.com/xyz/folder2 or ...
0
votes
2answers
22 views

Can I make Apache ErrorDocument return 404 instead of 301?

In my .htaccess I have ErrorDocument 404 http://foo.com/404.html It works, in the sense that I recover from any file not found error and show the 404 page instead, but the way it works is to ...
0
votes
1answer
24 views

http to https using htacess file [duplicate]

I went the entire website to be accesed only with https. In .htacess to i written the following rule RewriteEngine On RewriteCond %{HTTP_HOST} ^www.my-website.com [NC] RewriteCond %{SERVER_PORT} ...
-6
votes
0answers
36 views

Convert Nginx rewrite to htaccess [duplicate]

Nginx rewrite: if (-d $request_filename) { rewrite ^/?$ /get_doc.php last; break; } if (!-e $request_filename) { rewrite ^/?admin /get_admin.php last; rewrite ^(.*)$ ...
0
votes
1answer
39 views

Force SSL for every URL except one path using .htaccess

I'm trying to enforce SSL for every URL except one with the first segment /preview. http://test.example.com/preview/blah/blah should be ignored by the rule; every other URL should be forced to use ...
-1
votes
2answers
55 views

How to use .htaccess and .htpasswd for selective redirects & passwords

In my /var/www/ directory I have many directories some like: /var/www/impdata/ /var/www/data/ So can I achieve this: When I go to: www.websitename.com/data/ it should give an 404 error. And when ...
-1
votes
1answer
24 views

Redirection of http to https not working [duplicate]

I want to redirect my subdomain to https. My .htaccess file contains the following: RewriteEngine On RewriteCond %{HTTPS} !on RewriteRule (.*) https: //%{HTTP_HOST}%{REQUEST_URI} It's redirecting ...
-1
votes
1answer
25 views

.htaccess 500 Internal Server Error [closed]

I followed a pretty simple tutorial yet get 500 when i try. (of course, testfolder & user_name is in place of real credentials). the dir in question is owned by root. the user i used on the last ...
0
votes
1answer
12 views

.htaccess creatin loop when redirecting to ssl

I'm trying to redirect http:// to https:// I used cpanel redirect option but doesn't work work because is creating a loop and the browser stops. I also want that the .htaccess redirect code to be ...
1
vote
1answer
33 views

Different php_value open_basedir based on domain name in .htaccess

I want to limit access to files using PHP open_basedir for multiple domains. Every domain sits in own directory, so I want prevent all domains PHP scripts from interfering with each other. How can I ...
-1
votes
0answers
13 views

htaccess redirect a path to external website only if the website match a value

I have a website reachable by example.com. Now, I'd like redirecting all the pages example.com/admin/ to the homepage (example.com), but the rule should not be applied if I reach the website via IP ...
0
votes
1answer
19 views

Include more than one file in negative RewriteCond

I'm using this rule to ignore index.php in rewritte rule: RewriteRule ^((?!index\.php)[^/]+)/?$ galeria.php?nome=$1 [L,QSA,NC] But I need to include bio.php and contact.php in this rule. How can I ...
0
votes
1answer
25 views

How to use parts of the old URL in a 301 redirect [duplicate]

is it possible to keep certain parts of an URL and to rewrite the rest? With a .htaccess 301 redirect. In my example I would like to rewrite URLs from this format http://blog.example.com/post-name ...
0
votes
2answers
48 views

Folder outside of root folder and URL Rewrites

is the following scenario possible and how do I archive that in a shared hosting environment? I have a Wordpress installation which resides in, say, /httpdocs/wordpress My domain points to this ...
0
votes
1answer
56 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 ...
0
votes
2answers
28 views

Apache Alias to link to another DocumentRoot

I have a WordPress installed in /var/www/wordpress/ and my own code in /var/www/project/ Now comes the following problem: When I try to access example.com/client/ or example.com/admin/ it should link ...
0
votes
1answer
14 views

Apache redirect and pass query string on to remote host

I'm hoping this is super easy for someone. I need to create a redirect in apache where... http://something.com/a/1234567890 -> http://other.com/a/1234567890 http://something.com/a/8971347873 -> ...
0
votes
0answers
17 views

htaccess with accents breaks url with ñ character

I have the following htaccess with the url: http://localhost/caña working fine. <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} -f RewriteRule .? - ...
0
votes
0answers
13 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 ...
-2
votes
0answers
23 views

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

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
22 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
16 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
30 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
47 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
29 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
31 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
22 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
36 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
47 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
11 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
21 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
44 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
45 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
27 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
36 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
110 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
25 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
74 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
vote
1answer
148 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 ...
0
votes
0answers
57 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 ...
0
votes
1answer
54 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
65 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
28 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 ...
0
votes
0answers
66 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
53 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 ...