Directory-level configuration file found mostly on Apache web servers

learn more… | top users | synonyms (1)

0
votes
1answer
834 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 ...
-3
votes
0answers
11 views

Redirecting an entire site to new one, some links still throw HTTP 500 error

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 ...
0
votes
0answers
12 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
12 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
votes
2answers
53 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 ...
2
votes
1answer
2k 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
1answer
23 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} ...
0
votes
2answers
20 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 ...
-6
votes
0answers
34 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
36 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 ...
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
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 ...
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
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
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
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
31 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
814 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
votes
0answers
12 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
2answers
47 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
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 ...
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", ...
0
votes
2answers
986 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 ...
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
1answer
51 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 ...
1
vote
1answer
346 views

in an SSI include, can the file being included be redirected in an .htaccess file

I have some old html pages that have SSI includes in them to include certain html in all the pages. So, the SSI looks something like this: <!--#include ...
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
0answers
2k views

cant remove index.php from url in codeigniter

iam new in codeigniter frame work,i want to remove index.php from url and tried many times bt its not working..... here is my .htaccess file RewriteEngine on RewriteBase /test/ RewriteCond $1 ...
0
votes
1answer
795 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
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 -> ...
15
votes
3answers
28k views

How to enable either Gzip or Deflate compression via .htaccess?

How to enable either Gzip or Deflate compression via .htaccess and which one is best these days? Code examples needed.
3
votes
2answers
1k views

URL Rewriting Problem

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
0answers
16 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 .? - ...
3
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
0answers
12 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
14 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
29 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
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
42 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
28 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 ...
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. ...
-1
votes
1answer
35 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 ...
1
vote
2answers
747 views

Invalid command 'AuthType', perhaps misspelled or defined by a module not included in the server configuration

I'm trying to password protect the document root and all I get is an "internal server error" page. The Apache error log shows: Invalid command 'AuthType', perhaps misspelled or defined by a module ...
-3
votes
1answer
42 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 ...
6
votes
1answer
6k views

Apache .htaccess <ifModule not allowed here

Running Apache on Ubuntu Precise, with PHP 5.5 Trying to access my var/www/ gives me a 500. /var/log/apache2/error.log shows: /var/www/web/.htaccess: <IfModule not allowed here my .htacess is ...
1
vote
1answer
124 views

Enable FastCGI on Litespeed

How would I enable my Litespeed server to process .fcgi files using a FastCGI module? I tried setting the handler to fcgid-script already but that doesn't work. Syntax: AddHandler fcgid-script ...
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 ...