Directory-level configuration file found mostly on Apache web servers

learn more… | top users | synonyms (1)

4
votes
2answers
192 views

One million redirects

What's the best way to redirect 1,000,000 unique URLs to another 1,000,000 unique URLs? These pages are all combinations of multiple search filters and queries. We're migrating the site to cleaner ...
4
votes
2answers
572 views

Redirecting URLs when launching a new website - how to avoid dropping page rank

i have over 100 urls in my website which i need to redirect: E.g. /page/how-to-bake-chocolate-cookies/ will redirect to /cookies/how-to-bake-chocolate-cookies/ /page/contact/ will redirect to ...
4
votes
2answers
202 views

Any chance to redirect homepage to a changing permalink without irritating search engines?

We have a php 5.3/Apache 2.2 based cartoon website that always shows the most current cartoon on the homepage (index.php). Now, a lot of people want to link directly to that cartoon (by copying the ...
4
votes
1answer
80 views

Is there any difference, from Google's point of view, on the method used for a 301 redirect?

I have a website with an extremely good Google rank for it's particular niche. I've rebranded and need to redirect to a new URL. In the eyes of Google, what's the difference, if any, between the ...
4
votes
4answers
261 views

How to restrict access to my site using htaccess

How to disallow access to site except me?
4
votes
1answer
804 views

What are the most commonly used and basic Apache htaccess redirects?

This question is here so we can offer users who are looking for information on how to make one or more common or basic redirects in Apache using the htaccess file. All future questions pertaining to ...
4
votes
1answer
313 views

.htaccess and gzip compression

i have question about GZIP compression, actualy my wordpress website doesn't have .htaccess to be able to use that feature, so can i create .htaccess file only for gzip, it won't change anything on ...
4
votes
3answers
2k views

using .htaccess to redirect .asp to .php?

Ahoy all! I've been racking my brain with this one. I basically just converted all of my pages from ASP code to PHP code. Kept the same filenames. So, here is the htaccess code I have so far, but ...
4
votes
2answers
3k views

How to write a generic .htaccess file rule, regarding RewriteBase

The following rule in my .htaccess works just fine for routing calls to index.php: RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php [QSA,L] However, this does not ...
4
votes
1answer
280 views

Hosting multiple sites - Mask URL?

I have a hosting account where I have my main site (www.mainsite.com points to root folder), and a subfolder xpto.com, where I want to have another site (www.xpto.com). I can access ...
4
votes
1answer
2k views

How to set up a 403 forbidden

I've recently set up my first commercial website for someone, with godaddy hosting. I want to set up a 403 forbidden on several directories (and their contents) that are referenced to through php ...
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 ...
4
votes
1answer
57 views

Statically mapping a PHP script to another script using an .htaccess file results in 404 errors

After having read a lot of posts on the topic of URL rewriting, I still remain stuck with 404 status errors. My goal: A 'static' rewrite of URLs, as follows (user clicks or enters the one ...
4
votes
1answer
174 views

Best way to protect public facing development environments?

We're in the process of setting up individualized dev environments for our developers. All of our developers are remote and we don't have a VPN or anything to bring this in house. But here's the ...
4
votes
1answer
190 views

Do Dynamic Subdomains Harm SEO or not?

I am establishing a new website for just resumes, and I structured my htaccess as to provide dynamic subdomains as: marketing.resumedomain.org/index.html sales.resumedomain.org/index.html ...
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? ...
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 ...
4
votes
1answer
792 views

Password protect an alias virtual directory

I have a main domain being hosted through CPanel. I also have a sub-domain that I would like to appear as a path under the main domain instead of as a sub-domain. So I have: http://example.com/ ...
4
votes
3answers
1k views

Redirecting subdomain to root index.php

I am new to this. Here is the situation and I'm wondering if someone can suggest the best solution to it: I have a domain www.mydomain.com where I have a Magento website running, we are in ...
4
votes
2answers
335 views

.htaccess URL rewrite [closed]

I used to have a rewrite rule to RewriteRule ^([^/]+)\.htm$ index.php?c=$1 [NC] RewriteRule ^([^/]+)\.htm/([0-9.]+)$ index.php?c=$1&amt=$2 [NC] Now, I have to change to RewriteRule ...
4
votes
1answer
250 views

How to externally host a mobile website?

I've built a cool mobile website/app using JQuery Mobile. I want to offer that to clients, but I want to use my own hosting. Here's what I want to do If a user uses a mobile device to visit ...
4
votes
4answers
1k views

htaccess 301 redirect help needed(removing GET parameters)

Due to some issues in my site many pages are visible as duplicate using : www.example.com/page.html?task=view but it's content is exactly same as www.example.com/page.html. One way is to use http 301 ...
4
votes
2answers
4k views

.htaccess directory to subdomain

I have been trying to make a subdomain from a directory (made by .htaccess) to be used as the main page starting like http://domain.com/sub/2/3/4.html and turning into ...
3
votes
9answers
10k views

Need to Stop Bots from Killing my Webserver

I am having EXTREME bot problems on the some of my websites within my hosting account. The bots utilize over 98% of my CPU resources and 99% of my bandwidth for my entire hosting account. These bots ...
3
votes
3answers
306 views

Redirection to load a CSS file

I have in a remote server with this index.html that I can not modify: <link rel="stylesheet" type="text/css" href="styles.css" /> But my styles.css file is not at the web root, that is ...
3
votes
2answers
3k views

Use .htaccess to rewrite requests for a PNG as a PHP GET variable

I'm REALLY bad with .htaccess files, and reading through the existing questions on SO only confuse me more (mainly because they're all situation-specific and don't exactly apply to my situation at ...
3
votes
2answers
270 views

Can the .htaccess file slow down a website to a crawl? If so, are there better ways to solve these problems with different rewrite rules and such?

here is my htaccess file...... RewriteCond %{REQUEST_URI} ^/patients/billing/FAQ_billing\.html$ [OR] RewriteCond %{REQUEST_URI} ^/patients/billing/getintouch\.html$ RewriteRule ...
3
votes
2answers
103 views

Installing a PHP framework to a host without public_html or www folders (ftp is DocumentRoot)

I've developed a PHP framework that operates with the directory structure of / /classes/ /templates/ /.../ /www/ (public_html) But I've come across a host that only allows ftp to the ...
3
votes
3answers
2k views

Subfolder won't permenantly redirect to subdomain

Right now I have the following code to redirect all non-www URLs to www URLs: RewriteCond %{HTTP_HOST} ^example.com RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L] Besides that redirection, ...
3
votes
3answers
545 views

SEO Joomla URL to WordPress URL's

I am trying to migrate from Joomla 1.5 SEF URL's to WordPress SEF URL's. The old links use this formatting: /site/sectionname/categoryname/id-titlename.html I want to migrate it to ...
3
votes
1answer
186 views

Stop Apache serving filetypes

Preferably using .htaccess files, though .conf files are an option, is there any way to stop Apache serving certain filetypes? For example, .db shouldn't be served for obvious reason (privacy and ...
3
votes
2answers
18k views

How to set suhosin.post.max_vars in a htaccess file

I need to add this values to my htaccess: suhosin.request.max_vars = 8000 suhosin.post.max_vars = 8000 If I just add them like that I get an Internal Server Error Which is the right way to ...
3
votes
1answer
13k views

How to redirect any URL to lowercase URL?

I have this .htaccess files: ErrorDocument 404 /index.html <IfModule mod_rewrite.c> Options +FollowSymLinks RewriteEngine On RewriteCond %{HTTP_HOST} ^domain\.com [NC] RewriteRule (.*) ...
3
votes
2answers
158 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} ...
3
votes
1answer
352 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 ...
3
votes
1answer
984 views

What do I put in htaccess to create a 410 error page when a URL parameter is present?

I tried to create a 410 error page but realized that I actually created a 302 redirect to a 410.php page. Instead I want to use a 410 error to block out an infinite number of dynamically created pages ...
3
votes
1answer
149 views

301 redirects… www. > http … the entire sitemap

I submitted a duplicate sitemap some time back to incorporate the www. addresses when I saw my site was not directing there when I typed it directly in the address bar. As I have edited my site and ...
3
votes
2answers
165 views

Redirecting WWW.website.com to website.com

I ranked my site at Nibble.com and i was going through everything, checking for ways to improve my website, and I noticed that www.website.com was classed as a duplicate of website.com. How do I ...
3
votes
1answer
155 views

URL hex characters in .htaccess

There is an old page with a space in the filename, and this is no longer found on the website. So I need to redirect this page to another page using a 301 redirect in .htaccess. If I place the ...
3
votes
1answer
537 views

Disallow all user agents except one using .htaccess?

I've been struggling to get this .htaccess working. The aim is to disallow all user agents besides my app. The app sends a GET request with a user agent of lets say 'AcmeUpdater'. Whenever I try to ...
3
votes
1answer
812 views

Apache show file index as utf-8

I'm on a shared hosting which runs Apache on a Windows server. I am running Linux and I have uploaded some files that should be accessible directly via a public URL (that is known only by a few ...
3
votes
1answer
55 views

How to have my customized extension?

I have recently found a .htaccess trick in which I can remove file extension from the URL, example.com/file.html looks like example.com/file Now my humor says that I can replace any extension to my ...
3
votes
1answer
371 views

Block images on Russian domain .ru via htaccess?

I have a WordPress website which accepts anonymous comments and images. We are receiving spam in the form of Russian porn, with images hotlinked from websites on the Russian domain .ru As we are ...
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 ...
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 ...
3
votes
2answers
73 views

non-cachable Canonical redirect of www to non-www

I know this question is debatable for the whole eternity, and most likely nobody knows the real philosophy of this problem. But I'm trying to solve the problem about 301 and 302 response headers in ...
3
votes
1answer
248 views

301 Redirect a domain to another domain, but keeping the subdirectories the same

Is it possible to configure a top-domain (http://x.com) (DNS/.htaccess/else?) to redirect to another domain (http://y.com), whilst if you navigate http://x.com/subdir/index.html, you'd see the files ...
3
votes
1answer
46 views

Which domain should I authorize in my .htaccess to let google spreadsheet access files on my site

I use google spreadsheet feature that allows one to let an image be the content of a cell. The cell is defined by: =image("http://www.example.com/my-pics/my-pic.jpg") It works pretty well. But, I ...
3
votes
1answer
220 views

Redirect www to non-www using Apache htaccess does not work

I have this in my .htaccess (modified from the default Drupal .htaccess): RewriteCond %{HTTP_HOST} ^www\.website.com\.com$ [NC] RewriteRule ^(.*)$ http://website.com/$1 [L,R=301] In theory this ...
3
votes
1answer
865 views

How to make “crawl-delay” works for all “user-agent” in robots.txt or in .htaccess?

I have this line: Crawl-delay: 50 in the robots.txt file at the root of my website. But it seems that it is not working at all. I get 400 visits from the Yandex user agent in a few minutes. I ...