Directory-level configuration file found mostly on Apache web servers

learn more… | top users | synonyms (1)

1
vote
0answers
10 views

.htaccess redirect keeping url when there is wordpress code involved [duplicate]

I have two domains, alfa.com and beta.com. Beta.com points to alfa.com subdirectory named "ae" by following htaccess-file. It works fine, but what should I add to code to keep beta.com URL and not ...
0
votes
1answer
38 views

Transforming URLs with query strings to simple URL with subdirectory

I need to redirect all URLs with query strings like: www.example.com/?query to www.example.com/query ie I only need to remove the ? after the URL and preserve the query like a subdirectory request ...
1
vote
1answer
49 views

How to include local settings in an .htaccess file that is shared between different servers?

I am running a small network of web servers (Apache 2.2/2.4) using essentially the same CGI infrastructure on different machines (and under different domains). The function of each site depends on ...
0
votes
0answers
126 views

wordpress 4.1 force http intp https with .htaccess

I would like to force https with correct Comodo Certificate, in the website www.cabdrome.com with .htaccess (and not only from php). My webserver suggest to use these row to force HTTPS for an entire ...
0
votes
1answer
34 views

Block a unique hash in URL through NGINX

I need to block a hash which is inside a URL through nginx. The URL which requires to be blocked is ht tp:/ /mp3s tri ng.c ...
0
votes
1answer
607 views

Apache authentication inside a WordPress install

I am currently running into an issue with trying to password protect a directory that is sitting inside a directory that's running WordPress. This is for a directory called "admin" that handles a few ...
0
votes
0answers
10 views

how can I make wp-content/uploads directory not accesssible [closed]

I read quite a lot of advice but nothing seems to work. What I want is - the directories in wp-content/uploads to be not accessible by the public. And also - if someone type up this directory to be ...
0
votes
1answer
36 views

Apache not allowing .htaccess

I upgraded my Ubuntu to 14.04 LTS and Apache to 2.4. When the server first started back up I was getting 403 errors visiting pages. This is when I learned I needed to change to Require all granted. I ...
1
vote
2answers
88 views

Redirect http to https with htaccess does not work

# BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} ...
1
vote
0answers
33 views

Convertion of htaccess rewrite rule to nginx [closed]

Through searching the internet with "converting htaccess to nginx rule" I came up with anilcetin and winginx .htaccess to nginx converter which I doubt it doesn't correctly output what I need. Which ...
0
votes
0answers
11 views

Redirect old domain to new domain [closed]

I have a problem here. My old and new domain are in the same document root(public_html/domain) I want to redirect the old URL to New URL. I used this code and put it in .htaccess but didn't work: ...
0
votes
0answers
19 views

Mod-rewrite with GET [duplicate]

I'm trying to get my htacces to rewrite URLS with GET parameters but hopelesly failing. I'd like for this: domain.com/landingpage?variableone=true&variable2=false to be converted to this: ...
0
votes
0answers
26 views

Apache mod_rewrite to remove slashes is writing redirect using the filepath not a uri

Unfortunately I don't have direct access to this server so trial and error via a proxy person is proving difficult. We have the following Location directive (along with others) within a VirtualHost ...
8
votes
1answer
2k views

SSL redirect on EC2 instance behind SSL terminating load balancer

I'm trying to redirect all url's to https in a web application. I have an ec2 instance behind an elastic load balancer. SSL is terminated on the load balancer. Any attempts at redirection end up ...
-2
votes
2answers
45 views

What will happen if I force https for my image hosting site via .htaccess but embed an image with an http link? [closed]

I've built myself a small image hosting service for my own projects and I recently switched the site to https which works perfectly. Now I made a .htaccess file with a rewrite rule as described here ...
0
votes
1answer
52 views

Enable curl_exec() in a sub-folder

Curl is enabled on the server but curl_exec function is disabled for security reasons. disable_functions = exec,passthru,shell_exec,system,proc_open,popen, ...
0
votes
1answer
60 views

.htaccess redirect only when URL doesnt match a specific URL [duplicate]

In our app we allow custom domains, so a user can create: custom.my.example.com Which we map to: app.our.example.com In our app we enforce SSL, except for when the user enters a preview URL such ...
2
votes
2answers
98 views

Redirect depending on preferred language (Accept-Language) with .htaccess

When users request /, I want to redirect them to /en or /de, depending on their preference specified in the HTTP request header Accept-Language. I guess this is easy with server-side scripting, but I ...
2
votes
1answer
110 views

Force SSL not working either with Joomla or htaccess

We have a multiple sites in Joomla. Following are the details. Hosted on domain mydomain.co.in, sub.mydomain.co.in. Amazon EC2 instance, behind load balancer. We have bought WildCard SSL certificate ...
0
votes
2answers
116 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 ...
0
votes
2answers
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
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
299 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
vote
1answer
36 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
26 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
37 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
19 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
127 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
52 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 ...
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
61 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
0answers
30 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 ...
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
239 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
22 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
93 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
63 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
72 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 ...
2
votes
1answer
194 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
20 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 ...
0
votes
1answer
562 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
35 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
64 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
131 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
135 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
176 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
60 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 ...