Directory-level configuration file found mostly on Apache web servers

learn more… | top users | synonyms (1)

1
vote
1answer
812 views

What can cause RewriteRule to work only for certain pages?

Is there any extern factor (that is, not in the .htaccess file) that can cause the RewriteRule not to work for specific URLs (of existing pages)? I have the following code in the .htaccess (it ...
3
votes
2answers
432 views

RewriteRule not working for certain URLs

There are a few domains pointing towards the same server, and of course I need them all redirect to only one of them. Redirects work, but only for certain URLs. What works: http://www.domain.com, ...
2
votes
1answer
156 views

Apache mod_rewrite problem

I try to use Apache mod_rewrite to redirect some pages on my customer's website to the homepage. The .htaccess file is the following: <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / ...
1
vote
3answers
117 views

mod_rewrite: rewriting http://$SOMETHING.app.example.com/ to http://www.example.com/app/$SOMETHING

I'm trying to make http://$SOMETHING.app.example.com/ transparently rewrite to http://www.example.com/app/$SOMETHING. The config below is giving me a 404 and I'm not sure why. ServerName ...
1
vote
1answer
11k views

.htaccess password protection generates 500 internal server error

I have created a .htpasswd file using htaccess tools of which I have uploaded to the root of my web hosting space (/public_html is my web root). I created a .htaccess file which referenced the ...
10
votes
2answers
686 views

Homemade URL shortener redirect conflicting with 301 redirects

I have a website which was originally built using classic ASP. About a year ago it was rewritten in PHP. This caused file extensions to change and some pages were moved to new locations within the ...
1
vote
1answer
2k views

mod_rewrite with Apache -> mod_jk -> tomcat

Related to some of my earlier questions. I now have a setup I quite like; Apache httpd listening on port 80 accepting http and https connections. Several Tomcat instances running on several AJP ...
3
votes
4answers
2k views

How to create .htaccess to block access to a subdirectory that hosts a separate domain

So I am pretty noob at with creating code in .htaccess, but I know it is what I need to accomplish a pretty simple task. So here is what I want to do. I have a main domain, (me.com), and I am hosting ...
1
vote
1answer
424 views

Can I remove visible referer from link?

I use referer info to track which of my campaigns works the best. So instead of <a href="someweb.com">someweb</a> I have a link like <a ...
2
votes
2answers
1k views

How can I redirect everything but the index as 410?

Our site shut down and we need to give a 410 redirect to the users. We have a small one-page replacement site set up in the same domain and a custom 410 error page. We'd like to have it so that all ...
1
vote
1answer
143 views

Redirects in .htaccess to avoid crawl errors

I am getting a lot of errors in Webmaster Tools and basically there's a lot of links ending like this: mydomainname.com/links.php How can I redirect these links, to shave off this part at the end? ...
3
votes
2answers
568 views

How do I redirect an English language URL to an Arabic language URL?

I have a link that's currently formatted like this: http://site.com/news/view/1.html I want to it redirect it to: http://site.com/خبر/عنوان-الخبر where خبر is equal to news and عنوان-الخبر is ...
0
votes
1answer
99 views

Uses of .htaccess files [closed]

I only have a basic understanding of .htaccess files. What are some tasks that can be accomplished using them? What are good resources that would aid in learning how to use them on a more advanced ...
4
votes
1answer
1k views

Can I enable GZIP on Godaddy?

One of my sites lives on GoDaddy's bottom-of-the-line cheap hosting, I have the correct code in my .htaccess file, but it's not compressing because mod_deflate is not loaded. How do I enable that? ...
3
votes
2answers
134 views

Implications on automatically “open” third party domain aliasing to one of my subdomains

I have a domain, let's call it www.mydomain.com where I have a portal with an active community of users. In this portal users cooperate in a wiki way to build some "kind of software". These software ...
0
votes
1answer
271 views

How to block access to a sub-site with mod_rewrite?

Let's say I have the sites siteA.com and siteB.com. They are hosted such that siteB.com actually points to siteA.com/siteB. How can I block someone from visiting siteA.com/siteB using mod_rewrite? ...
2
votes
3answers
293 views

Mod Rewrite question

Is there a way to rewrite http://localhost/embed/player.swf?file=http://www.youtube.com/watch?v=7yKDhm4_-90 to something smaller? or is there a way to change this into ...
2
votes
1answer
376 views

Gzip compress offline?

I've configured my site to serve compressed content by putting this line in .htaccess AddOutputFilterByType DEFLATE text/html text/plain text/xml text/javascript text/css application/javascript ...
0
votes
3answers
584 views

.htaccess RedirectMatch 301 issue

I've moved my WordPress installation from one domain to another, and I want to use an .htaccess file on the original to redirect visitors to the new page on the new website. The old site is ...
1
vote
2answers
99 views

rewrite on urls to add “/”

I know how to rewrite urls to redirect to a page. When the "/" is not at the end of www.DomainName.com/user/myUserName the redirect works: RewriteRule /$ /user/index.php When I write RewriteBase / ...
1
vote
2answers
634 views

.htaccess rules to rewrite URLs to front end page?

I am adding a new application to my site at example.com/app. I want views at that URL to always open myapp.php. E.g. example.com/app -> example.com/app/myapp.php and example.com/app/ -> ...
0
votes
2answers
339 views

block users by country in .htaccess

Is there a way to block users from a particular region. Currently I have compiled a list of over 100 IP addresses that I block in my .htaccess file. Unfortunately as the list grows I see a great ...
0
votes
1answer
350 views

htaccess rewrite - Associating subfolders of web root as index of domain

I've been trying to find specific information on the problem, but it all seems rather confusing or irrelevant. I have an Apache install with several subfolders with different websites. I need ...
5
votes
1answer
896 views

How to internally rewrite a page when requested from specific HTTP_HOST

I have a Drupal site, site.com, and our client has a campaign that they're promoting for which they've bought a new domain name, campaign.com. I'd like it so that a request for campaign.com internally ...
0
votes
2answers
161 views

Is it possible to mod_rewrite BASED on the existence of a file/directory and uniqueID?

My site currently forces all non www. pages to use www. Ultimately, I am able to handle all unique subdomains and parse correctly but I am trying to achieve the following: (ideally with ...
0
votes
1answer
689 views

.htaccess: Redirect Hotlink Flash --> Site with embed Flash

I have some PHP sites that embeds SWF files. These SWF files are now linked to by some other guys. And I don't want them to simply open the SWF, I want them to force being redirect to the page where ...
2
votes
1answer
494 views

Multiple 301 redirects, do search engines/viewers see them all?

I've put in place lots of different 301 rules to deal with numerous url changes. And for certain URLS there are 3-4 different 301 redirects landing the visitors to the new URL. I heard that 301 ...
2
votes
2answers
3k views

Mod Rewrite - directing HTTP/HTTPS traffic to the appropriate virtual hosts

I have an Apache2 web server (v. 2.2.16) running on Debian hosting three virtual hosts. The first two hosts are HTTP only (server1 and server2). The last host is HTTPS only (server3). My virtual host ...
0
votes
1answer
130 views

Propagaging Apache rules Automatically for all folders Beneath Root

my webroot folder /httpdocs folder contains a .htaccess file The first lines look like this: RewriteEngine on RewriteBase / AddDefaultCharset UTF-8 Options +FollowSymLinks -Indexes -ExecCGI # ...
4
votes
2answers
512 views

Trigger IP ban based on request of given file?

I run a website where "x.php" was known to have vulnerabilities. The vulnerability has been fixed and I don't have "x.php" on my site anymore. As such with major public vulnerabilities, it seems ...
5
votes
2answers
5k views

htaccess execution order and priority

Can anyone explain to me in what order apache executes .htaccess files residing in different levels of the same path and how the rewrite rules therein are prioritized? For example, why doesn't the ...
0
votes
3answers
157 views

.htaccess redirect question

I'm trying to set up my .htaccess file to take the displayed link and route it to the destination link as below Displayed Link ...
0
votes
1answer
396 views

Force www. on multi domain site and retain http or https

I am using CakePHP which already contains an .htaccess file that looks like: <IfModule mod_rewrite.c> RewriteEngine on RewriteRule ^$ app/webroot/ [L] RewriteRule (.*) ...
2
votes
1answer
1k views

=~ (equal-sign tilde) and m“ … ” in .htaccess directive

I saw this bit of code on an old forum post: SSLRequire %{HTTP_HOST} =~ m"\.secure\.powweb\.com" And I was just wondering what the =~ and m" ... " meant. I've been searching online and in the ...
5
votes
1answer
1k views

Redirect from SSL HTTPS to HTTP (NO SSL)

Many of my visitors have bookmarked my site already with https://mydomain.com. Under the bad advice of a programmer I have put my whole site (Joomla) using SSL. I do not sell anything or provide any ...
8
votes
3answers
3k views

Forcing SSL and www in .htaccess

I'm looking for a way to force SSL and www. I've been able to force both separately but together I keep running into redirection issues. The following code works when handling a URL in this format: ...
3
votes
4answers
155 views

Question about mod_rewrite rule for redirecting failing pages

I'm setting up a mod_rewrite rule that redirects failing pages to a custom "Page Not Found" page. This is with WordPress. I've used an online tutorial from the Apache site and so far my rules look ...
4
votes
1answer
8k views

Properly force SSL with .htaccess, no double authentication

I'm trying to force SSL with .htaccess on a shared host. This means there I only have access to .htaccess and not the vhosts config. I know you can put a rule in the VirtualHost config file to force ...
1
vote
7answers
6k views

Blocking all countries except US/Canada/UK

I have a site which is only for US/Canada/UK visitors. I don't want to make it visible to other visitors. I tried to put IP ranges in .htaccess (Deny IP) but it does not work for me. May be I have ...
0
votes
1answer
160 views

How can I work on a WordPress theme already installed in the root directory?

I have WordPress installed at the root level of a website. I thought it would be easy enough to have a "coming soon" page called default.html and edit the .htaccess file as follows: AddHandler ...
2
votes
1answer
1k views

Joomla 1.6 URL rewrite on IIS7 (removing /index.php/)

Joomla 1.6 was released today and I'm wondering if anyone knows how to get rid of the /index.php/ part? How link looks now: http://www.example.org/index.php/stuff How link would look after URL ...
1
vote
1answer
537 views

HTAccess redirect directories to index.html

I am working on a site that where I do not have permission to the server and someone else keeps changing the settings. That person just changed the settings preventing users from going to ...
1
vote
1answer
317 views

Redirect before rewrite

Had an issue where I need to redirect old URLs, but not disable the mod_rewrite for page structure. redirect 301 /home.html http://www.url.com/ It needs to live on the Symphony 2.0 .htaccess file ...
0
votes
1answer
961 views

Replace %26 in htaccess to %2526

I would like htaccess to rewrite example.com/something_%26_else into example.com/something_%2526_else. I'm importing a bunch of pages that have ampersands in the title from Mediawiki. These are ...
0
votes
1answer
319 views

Website won't load in Firefox 3.6.13

After the latest version of Firefox came out, I've been having problems with my website. The site is: http://mojheroj.com It works fine in all other browsers, as well as older versions of Firefox and ...
1
vote
1answer
826 views

How secure is using .htpasswd to secure a directory?

I'm basically creating something off of my main domain www.mywebsite.com/intranet. I've created .htpasswd protection for that intranet directory. I can't implement individual user passwords yet and ...
0
votes
2answers
85 views

is there a way to write .htaccess shorter?

RewriteRule ^([A-Za-z0-9_\-]+)$ /userviewproducts.php?category=$1 [L] RewriteRule ^([A-Za-z0-9_\-]+)/$ /userviewproducts.php?category=$1 [L] RewriteRule ^([A-Za-z0-9_\-]+/[A-Za-z0-9_\-]+)$ ...
2
votes
2answers
155 views

Howto use .htaccess with exclusions

I want all requests on a domain to be redirected to https, with the exception of just one particular file. I'm not sure how to accomplish that with .htaccess -bash-3.2# cat .htaccess ErrorDocument ...
4
votes
5answers
870 views

Site compromised .htaccess files everywhere

Some of the sites we're hosting are compromised by... I don't know what. Every directory on the webserver contains a .htaccess file which redirects a user coming from a search engine to a page which ...
0
votes
1answer
151 views

Controlling Access using htpasswd and htaccess

I've got a bit of a peculiar problem on my site. I'm using a .htaccess and .htpasswd file to protect the root of the site. This works great, but when I try to view a video file on my site, it prompts ...