Directory-level configuration file found mostly on Apache web servers

learn more… | top users | synonyms (1)

4
votes
1answer
294 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
1answer
838 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 ...
4
votes
3answers
1k 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
1answer
274 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
166 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
181 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
2answers
456 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
7k 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
672 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
788 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
1answer
2k 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
2answers
322 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
222 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
770 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
3k 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
7k 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
888 views

How do I block US users from my website without interfering with SEO?

My website uses Apache 2.2.14 (which forwards all requests to Tomcat underneath). I need to block all US users from accessing the website (and potentially users from other countries). But importantly ...
3
votes
2answers
229 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
94 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
440 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
142 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
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} ...
3
votes
1answer
11k 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
1answer
322 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
142 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
131 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
126 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
462 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
620 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
353 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
1answer
157 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
627 views

Can I allow access to a HTML page only if the user comes from a specific site with .htaccess?

A website with two HTML pages, A and B. Both can be accessed by typing the URL, of course. However, can I disallow any access to page B, and only allow it if the user is coming from page A? As in, a ...
3
votes
2answers
202 views

prevent hotlinking of off-site content?

I have a www.example.com site where I serve all static content (e.g. http.//www.example.com/image.jpg) off a CDN with URLs like http://static.example.com/image.jpg An Apache 2 .htaccess rule ...
3
votes
1answer
2k views

How to redirect specific url to 404 in htaccess?

I want to redirect only one specific URl (ex. mypage.com/1234/page/) to error page 404. How to achieve it in htaccess?
3
votes
1answer
198 views

How can I redirect all files in a directory that doesn't conform to a certain filename structure?

I have a website where a previous developer had updated several webpages. The issue is that the developer had made each new webpage with new filenames, and deleted the old filenames. I've worked with ...
3
votes
1answer
128 views

.htaccess Redirect Old Threads

I have moved to mybb to vanilla and want to redirect old threads to the new format, so the indexed threads on google aren't lost. The old format is showthread.php?tid=3003 Whereas the new ...
3
votes
2answers
306 views

Create friendly looking URL's with mod rewrite

I want to make the pages on my site more search engine friendly by turning the query strings into meaningful looking page names. For example I have a page that is this: /search.php?c=18 I want it ...
3
votes
1answer
1k 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 ...
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 ...
3
votes
1answer
112 views

htacess seems to make the page load forever

I need to rewrite a URL of my server so the URL looks friendly. Like: site.com/var1/var2/var3/... to site.com/index.php?page=var1/var2/var3/... So I wrote this .htacess: RewriteEngine On ...
3
votes
1answer
52 views

Make a domain point to another domain

I have never been able to figure out how to do this. I am working on a PHP script. With my script, each user will have access to their own site. For example, the URL for this would be ...
3
votes
1answer
479 views

Using .htaccess to set a cookie and 301 redirect

I currently have in my .htaccess: RewriteRule ^$ http://chfmaine.com/ [CO=moved:yes:chfmaine.com:1/,R=301,NE,NC,L] I was basing this off of this post. That's a lot more than I need but the setting ...
3
votes
1answer
80 views

Moving a WordPress site to a new domain - need help with an Apache htaccess URL rewrite rule

I'm helping to move a WordPress site from one domain to another, which includes a change in permalink structure. I know I can use a .htaccess entry, but I'm not that well-versed (yet) in regular ...
3
votes
1answer
346 views

How can I redirect old WordPress URL (with a query string) to new URL using .htaccess?

I transferred my WordPress site to static HTML website, but some other website have a link to my old WordPress site mysite.com/?page_id=1103. I want to redirect all traffic to new URL which is ...
3
votes
1answer
122 views

301 redirect for a page with a space in it

I have some pages from a client's old template-based site which have spaces in them. For example, one of the pages looks like this: example.com/page.php?domain_name=example.com&viewpage=Gallery ...
3
votes
1answer
609 views

Wild card redirect in htaccess giving error this webpage has a redirect loop

In my website I changed the directory name "vehicles-cars" to "vehicles-cars-for-sale". When I tried to redirect using a wild card redirect from my old directory name to new directory name in my web ...
3
votes
2answers
3k views

Removing .html and index.html from URL

I'm having some problems trying to Remove the .html extension from URLs Removing 'index.html' from an URL 1) To remove the extension I have tried using this in my htaccess file. RewriteEngine on ...
3
votes
1answer
583 views

Redirecting a .co domain to a .co.uk with masking

This is my first post here, so be gentle... A friend wanted a website and paid for one to be set up. For reasons unknown to me he ended up with hissite.co rather than hissite.co.uk, which is what ...