Directory-level configuration file found mostly on Apache web servers

learn more… | top users | synonyms (1)

0
votes
3answers
576 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
625 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
333 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
891 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
684 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
489 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
128 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
495 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 ...
4
votes
2answers
4k 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
391 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
153 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
5k 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
531 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
307 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
941 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
816 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
850 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 ...
5
votes
2answers
2k views

Rewrite rule to show as directory using .htaccess

I want to implement a rewrite rule in my .htaccess file to show a specific url as a directory of my server. See the code below I written, RewriteRule ^(.*)/$ ?page=$1 [NC] This will rewrites urls ...
0
votes
1answer
171 views

Restrict access of rewriting file using .htaccess

I rewrite my .php files to .htm, using the following code in .htaccess file. RewriteEngine on Options +FollowSymlinks RewriteRule ^(.+)\.htm$ $1.php [NC] This is working fine. But now I want to ...
1
vote
1answer
403 views

One-user databaseless CMS authentication

Background: My client needs a one-user bare-bones content management system, which should be capable to Edit text-content in plain-text or in WYSIWYG-style Possibly create new subpages Update image ...
1
vote
2answers
810 views

How do I force a www subdomain on both HTTPS and HTTP?

For whatever reason I can’t seem to get this right. I’ve looked at many examples on here and on the Apache website. I’m trying to force www.example.com instead of example.com on both HTTP and HTTPS, ...
4
votes
4answers
259 views

How to restrict access to my site using htaccess

How to disallow access to site except me?
3
votes
2answers
2k views

Share on Facebook does not show thumbnail images

I have a PHP application which has a "Share on Facebook" button that, On the development server shows the thumbnail images correctly and allows the user to select between them On the live server, it ...
0
votes
1answer
478 views

Redirecting dynamic pages to static pages URL

I decided to convert all my dynamic pages to static pages URLs. I used to have "/contactUS.php" and now I want the page to be served as "/contact-us". I used to following rule n .htaccess: ...
5
votes
2answers
1k views

How to 301 redirect from old query string URLs to CakePHP Canonical URLs?

I currently have a .htaccess file that looks like this: RewriteCond %{QUERY_STRING} ^action=view&item=([0-9]+)$ RewriteRule ^index\.php$ /index.php?url=item/%1 [R=301] RewriteCond ...
6
votes
3answers
2k views

.htaccess permanent redirect to www

I have a WordPress installation that is not redirecting URLs not starting with www. Example: http://example.com/dir/ doesn't send to http://www.example.com/dir/ instead goes to http://example.com/. ...
2
votes
2answers
425 views

Restrict access to web directory with .htaccess

Let me just say that doing this sort of thing with .htaccess files has never been a strong point for me. Let's say that I have a directory in my web root: /dir/data Within that directory let's say ...
3
votes
1answer
343 views

How do I normalise a URL from a folder to a subdomain?

I have a mybb forum hosted at a folder inside my site, which can also be accessed via a subdomain. I would like to configure it so that if someone would enter the folder it would automatically be ...
10
votes
1answer
323 views

301 redirects for all except me

i want to my site down for an hour and i was using order Deny,Allow Deny from all Allow from my.ip.add.ress but i dont like the default error page, is there a 301 redirct where i can redirect ...
3
votes
2answers
157 views

Not able to stop hotlink

I am using following htaccess code to stop hot linking my image files Options +FollowSymlinks Options +SymlinksIfOwnerMatch RewriteEngine on RewriteCond %{HTTP_REFERER} ...
2
votes
1answer
892 views

How to stop access of a PHP file from other sites

I read somewhere about hot linking of images. Preventing image hot linking helps to stop bandwidth theft from your site. Would it work for a PHP file? In my case, I am using a PHP file to generate ...
1
vote
2answers
254 views

Problem with htaccess causing images not to load

In my htaccess file, i am using below lines Options All -Indexes Errordocument 403 http://article-stack.com/ ErrorDocument 401 http://article-stack.com/ ErrorDocument 403 http://article-stack.com/ ...
0
votes
1answer
640 views

How to hide awstats url parameters

currently in order to access statistics on my site I access this link: www.mysite.org/awstats/awstats.pl?config=awstatsconffile.org all is working fine, but what I want to achieve is simply this: ...
2
votes
1answer
95 views

file need to go through a php page using .htaccess

I'm looking for a way to convert this type of url : h11p://www.mywebsite.com/dl/F5EGD6 Into h11p://www.mywebsie.com/dl/files/my_file.zip sing a PHP page to request the URL from the DB with F5EGD6. I ...
5
votes
2answers
832 views

URL rewritten pages take much longer to load

(Same issue as http://stackoverflow.com/questions/3987754/how-to-diagnose-htaccess-speed-issues-via-rewritelog but more clearly explained below) We have a site which has scripts like this: ...