Directory-level configuration file found mostly on Apache web servers

learn more… | top users | synonyms (1)

0
votes
0answers
10 views

Redirect to HTTPS but not a specific http

I am using Kohana Framework and have the following htaccess file: RewriteBase / RewriteRule ^(?:application|modules|system)\b.* index.php/$0 [L] # Allow any files or directories that exist to be ...
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
18 views

Apache LIMIT directive does not allow to see localhost project over LAN

I want to allow to see my localhost project over the LAN using Apache LIMIT directive in .htaccess my localhost project URL is http://192.68.0.123/myproject below is the .htaccess part which cause ...
-1
votes
0answers
16 views

Prevent iframe URL redirection in .htaccess

I am surviving from .htaccess 301 redirection issue. I need to redirect my my.domain.com/direcoryname urls to my.domain.com. It is working by Redirect 301 /directoryname my.domain.com/directoryname. ...
0
votes
1answer
853 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
1k 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
2answers
2k views

.htaccess - Too many redirects

I am getting a "too many redirects" error from the following two .htaccess files. .htaccess on domain 1 Redirect 301 / http://www.domain2.com/ .htaccess on domain 2 RewriteEngine On RewriteBase / ...
1
vote
2answers
215 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, ...
-1
votes
0answers
11 views

how to create several.htaccess rules

Can anyone please suggest how to rewrite rules in htaccess for the following: No direct access to folders and files except index.php Redirecting "https://example.com AND https://www.example.com AND ...
3
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
vote
1answer
33 views

Limiting the access to /wp-admin/ for the whole server

I want to limit the access to /wp-admin/ to specific IPs or even localhost it's described here http://codex.wordpress.org/Brute_Force_Attacks#Limit_Access_to_wp-admin_by_IP but that seems to be for ...
0
votes
1answer
19 views

.htaccess error with multiple rewriterules

I'm having a bit of an issue with my .htaccess file. I recently got an SSL certificate for my website and the https:// is working perfectly. However, I wanted to redirect any traffic using http:// to ...
0
votes
2answers
1k views

Only allow access to /admin from a specific domain?

If I have multiple domains pointing to the same site. If I have a domain called admin-domain.com I only want to allow admin-domain.com/admin/ But disallow anything-else.com/admin/ Also this ...
-1
votes
1answer
33 views

Do incoming https posts require https URL's

We would like to have HTTP posts from secure servers be secure on our end. Do the posts need to be made to https://ourserver.com, or does it work to post to http://ourserver.com, and then redirect to ...
0
votes
1answer
14 views

Easy way to make domain.com/wp-admin/ for all sites on a server accessible only for localhost?

I have problems with attacks to those so thought best would be to limit the access for them only to locahost. But what will be the best (and easy) way to do that?
0
votes
1answer
48 views

Apache 404 returning 500 errors. Request exceeded redirects

I'm trying to setup a site with static HTML with Apache 2.2.22, but I'm getting a 500 error instead of 404. The message in the error log is: [Sun Dec 14 09:48:45 2014] [error] Request exceeded ...
2
votes
2answers
38 views

Apache to Nginx Conversion (Newbie)

I've got a Nginx Web Server Setup with PHP and I want to move on Nginx and I want to convert these .htaccess rules to nginx.conf file: RewriteRule ^blog(|/)$ /data/core/site/blog.php RewriteRule ...
0
votes
2answers
837 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
vote
3answers
2k views

Authenticate users with LDAP and Apache 2.4

i would like to setup a LDAP Authentication with Apache 2.4. LDAP Sever is a Windows 2008. My .htaccess looks like: AuthType Basic AuthName "Login" AuthBasicProvider ldap AuthLDAPBindDN ...
0
votes
1answer
26 views

mod_expires does not affect caching

I have mod_expires installed in Apache on CentOS VPS. It is also listed in the loaded modules, I checked by this command /usr/local/apache/bin/httpd -l When I place the code in .htaccess, and then ...
0
votes
1answer
874 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 ...
0
votes
0answers
10 views

301 redirect with mod-alias and mod-rewrite

my htaccess file has these lines: RewriteRule ^newlink ?do=something Redirect 301 /oldlink/ /newlink when i write http://www.example.com/oldlink/, browser redirects to ...
0
votes
2answers
1k views

How to add an additional RewriteCond to exclude a specific url?

I have an existing .htaccess file with the following rewritecond: RewriteCond %{HTTP_HOST} !^go\.domain\.com$ [NC] RewriteRule ^(.*)$ https://go.domain.com [R,L] In essence, everything on this ...
3
votes
2answers
1k views

URL Rewriting Problem [duplicate]

I'm trying to rewrite my URL's subdomain. http://username.domain.com will show content of http://www.domain.com/user.php?u=username but URL stay as http://username.domain.com . (I mean url masking) ...
0
votes
1answer
235 views

Wrong redirection : problem with vhost?

i want to access to http://admin.my-app.com It is supposed to point on web/backend.php, but when i try to access via the URL, it redirects me to the index.php of my application. I don't know what ...
0
votes
1answer
20 views

Wordpress Opening From Wrong Directory

I have an Amazon ec2 m3 medium instance running AMI(RedHat based) Linux. I am trying to host multiple domains on this instance by adding this at the end of httpd.conf: <VirtualHost *:80> ...
-1
votes
1answer
50 views

Excluding a directory from a root .htaccess rewrite rule to disallow from caching

On my lamp installation, I have in the root folder "/" (mydomain.org) a wordpress multisite with W3 total cache activated, I have also a sub_dir called "sub" (mydomain.org/sub) with a PHP script ...
0
votes
1answer
912 views

Apache SetEnvIf failing to match Request_Uri

Simple condition, which never match and set variable: SetEnvIf Request_URI "^/path/to/something*" access_granted Checking URI by using PHP is giving correct string, however variable is never set. ...
4
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 ...
0
votes
1answer
61 views

Optimize .htaccess file

I'm trying to optimize my .htaccess file to avoid performance issues. In my .htaccess file I have something that looks like this: RewriteEngine on RewriteCond %{HTTP_USER_AGENT} bigbadbot [NC,OR] ...
-2
votes
2answers
1k views

.htaccess not working on my phpMyAdmin folder

I have a phpMyAdmin folder. So first I set .htaccess folder and type this in it. AuthUserFile /var/www/html/phpMyAdmin-3.4/.htpasswd AuthName "phpMyAdmin Login Page" AuthType Basic Require valid-user ...
2
votes
1answer
46 views

Can Apache .htaccess convert the percent-encoding in encoded URIs from Win-1252 to UTF-8?

I want to add a directive in my .htaccess, such that if the browser is pointed at a URI containing %E4 (ä) - or any other special character - the .htaccess automatically rewrites %E4 (ä) as %C3%A4 ...
-1
votes
0answers
68 views

How to fixe codeigniter 404 Page Not Found in linux hosting

I have .htaccess as below code # Set PHP Time Zone: #SetEnv TZ America/New_York <IfModule mod_rewrite.c> #Option +FollowSymlinks RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} ...
2
votes
1answer
65 views

Blocking all users without referrer BUT allowing Googlebot/bingbot at the same time (with .htaccess)

Because of some amateur-made DDOS attack on my website, I had to deny some traffic with .htaccess which worked fine. Unfortunately, it also blocks the googlebot/bingbot: order allow, deny deny from ...
0
votes
1answer
1k views

Server error 500 when adding .htaccess file in the root folder

I read a lot of server error 500 questions related to the famous .htaccess file but I have still not found an answer to this error. I have a folder which I used to test the .htaccess file. ...
0
votes
1answer
15 views

.htaccess entry to return simple text based on the URI

I have URL http://foo.com/bar?abc=123, what would be the correct entry in the htaccess file to return a simple text 200 status of abc=123? Basically, I just want to return the entire query string as ...
-1
votes
1answer
62 views

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

I have this line in a .htaccess file Options +SymLinksIfOwnerMatch ExecCGI Includes IncludesNOEXEC SymLinksIfOwnerMatch ExecCGI Includes IncludesNOEXEC SymLinksIfOwnerMatch ExecCGI Includes ...
0
votes
1answer
22 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 ...
0
votes
1answer
30 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 ...
-1
votes
2answers
78 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 ...
0
votes
0answers
28 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} ...
1
vote
2answers
49 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
68 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
1answer
32 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
18 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
55 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 ...
0
votes
2answers
59 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
23 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 ...
3
votes
4answers
6k views

How to redirect non-www to www without hardcoding using .htaccess?

RewriteEngine On RewriteCond %{HTTPS} !=on RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC] RewriteRule ^(.*)$ http://%1/$1 [R=301,L] ...causes a perfect, non-hardcoding 301 redirect from "www to non-www", ...