Directory-level configuration file found mostly on Apache web servers

learn more… | top users | synonyms (1)

0
votes
1answer
15 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 ...
-1
votes
1answer
31 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 ...
-7
votes
0answers
28 views

how to set up a cookieless sub domain to serve static contents? [on hold]

I am in search of developing a cookieless sub domain to serve my static contents in the web site. As I am a newbie to this field it look like a tough task for me. Can any one help me to find a ...
1
vote
1answer
29 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
13 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
43 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
35 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
votes
0answers
9 views

How install on wordpress subfolder a php script [closed]

Currently I have a wordpress on Nginx (mysite.com) but I need to install a php scrip in a subfolder. mysite.com/script/ What are the wordpress and script settings in its .htaccess documents ?
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
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> ...
0
votes
1answer
25 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 ...
-1
votes
1answer
41 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 ...
1
vote
1answer
34 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
42 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
52 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
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 ...
0
votes
1answer
21 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 ...
-1
votes
1answer
47 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
27 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
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 ...
1
vote
2answers
42 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
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} ...
-6
votes
0answers
37 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
58 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
74 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
30 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
53 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
1answer
21 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
26 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
58 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
84 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
33 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
16 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
27 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
14 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 ...
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
32 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
34 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
72 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
34 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
1answer
41 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
78 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
16 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
48 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
69 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
35 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 ...