Directory-level configuration file found mostly on Apache web servers

learn more… | top users | synonyms (1)

0
votes
2answers
2k views

.htaccess rewrite www to non-www and remove .html

I need rewrite rules to redirect the following: http://www. to http:// /file.html to /file I've tried using a combination of these but each time it results in a redirect loop on one of the ...
1
vote
3answers
866 views

What's wrong with my htaccess ? (500 Error)

I've written a small htaccess file to redirect Internet Explorer users to a specific page Here are the contents : # MS Internet Explorer - Mozilla v4 RewriteEngine On RewriteCond %{HTTP_USER_AGENT} ...
4
votes
2answers
205 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 ...
2
votes
0answers
167 views

Rewrite rule not matching second level directory URL [closed]

I have this .htaccess in a po_systems folder of my website # Set up mod_rewrite RewriteEngine on RewriteRule ^build_system/([^/]+)/([^/]+)/?$ ...
3
votes
1answer
3k views

Extend depth of .htaccess to all subfolders and their children

I need to be able to use .htaccess in all subfolders for full depth. E.g. I have .htaccess in public_html folder: \public_html\.htaccess How I make it to work for the folder small as well? ...
4
votes
1answer
281 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 ...
1
vote
2answers
989 views

Which method is better to add “www.” before domain name

I have search through Google and found 2 methods to add www before domain name. First is by adding a CNAME and second is using rewrite mod in .htaccess file. I just want to know which method is ...
1
vote
1answer
1k views

Stop directory listing using .htaccess and redirect to good error page

I have a directory with several sub directories. I found this article Preventing Directory Listing that shows me how to prevent people from getting the directory listings. IndexIgnore * But it ...
1
vote
1answer
98 views

Two different websites in one remote hosting

My client asked me that a website that is hosted in one server (and pointing there through a domain) should also be accessed (into a specific directory) from another domain, which is not pointing ...
6
votes
2answers
1k views

Redirect/rewrite dynamic URL to sub-domain and create DNS for subdomain

I have created an application in PHP, I would like to re-direct the following URL to corresponding sub-domain. Dynamic URL pattern: http://mydomain.com/mypage.php?user_name=testuser I wish to ...
1
vote
1answer
554 views

htaccess block access to directory but allow access to files

I need to block directory access but allow access to files if typed into a browser. Also would like this to load my custom 403.shtml
1
vote
1answer
663 views

how to best enable gzip compression on shared hosting

I must assume that this is a duplicate question, but I could not find the answer myself. I want to enable gzip compression to everything my website sends (mostly php, css, a slight bit of js). this ...
8
votes
1answer
3k views

Alternative to .htaccess (due to bad performance?)

I've been told that .htaccess should be avoided when possible, as it reduces the server performance and new servers disables it or just don't implement it anymore. I don't know how true this is, but ...
0
votes
1answer
998 views

Override .htaccess from parent directory

I have a local LAMP stack (without the MySQL. LAP stack? Anyways..) and I am using this as a development environment for a production website. The site is placed in a sub-directory of the Apache2 ...
2
votes
1answer
828 views

CMS Made Simple: Why does home page return a 404 under www subdomain?

Anyone know why my homepage wont load with the www prefix. Links such as www.mysite.net/about-us will load fine but www.mysite.net returns a 404. Everypage works including the home page if I ...
0
votes
1answer
191 views

htaccess performance issues vs restarting the server

 I usually use the server config file for settings that I would like to apply to my applications (at least in the development environment), and constantly have to re-start the server.   I ...
2
votes
2answers
442 views

Can you rewrite the root?

Not sure how to word this one but will explain most I can. I am trying to make the following happen. Re-write this http://example.com To this http://example.com/home/ Is it possible ? update ...
1
vote
1answer
61 views

Forcing adverts via apache configuration file

I have a server I am trying to force adverts for free users. I can do it with a .htaccess file with this line "php_value auto_append_file '/var/www/vhosts/demoblog/demoblog.tk/httpdocs/test_ad.php'" ...
2
votes
2answers
3k views

Is it possible to force a directory index to display even if an index file exists?

On my Apache server I need to display a directory index of a given folder even if it already contains an index file that has been defined in DirectoryIndex. In this case an index.html file exists, but ...
1
vote
1answer
31 views

Permalinks & domain name for application

I originally posted this on stackoverflow, then was told it didn't fit. I'm looking for some advice. I created an application that deals heavily with twitter & permalinks. I have yet to find a ...
12
votes
4answers
2k views

Blocking referral traffic

I am currently getting a massive amount of referral traffic to my site (Spam), that can sometime generate 1-2 GB worth of traffic per a day (which kinda sucks, when you have a 10GB limit from the ...
3
votes
1answer
280 views

How to make password protection with .htaccess file more user-friendly?

I have this in my .htaccess file: <FilesMatch "(contracts|concepts)$"> AuthName "Contracts" AuthType Basic AuthUserFile /is/htdocs/wp54963193_ZBG2Q9J2R8/www/.htpasswd ...
1
vote
3answers
1k views

Transparent PHP script execution using mod_rewrite

I am looking for a solution for this a problem: I need that every HTTP request (method is irrelevant) in Apache http server would be served only after execution of specific PHP script. This is needed ...
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 ...
7
votes
2answers
217 views

I want to test major changes on my website without hurting SEO

I want to replace all my website files for new ones on the server and to test if they work alright but I don't want to be crawled while this is happening or if I am, I don't want the crawler to be ...
0
votes
1answer
55 views

Domain problem: viewing one site OFF another site?

I have this scenario: I have a domain, let's call it "mydomain.com". Mydomain.com runs various "sub-sites", e.g.: mydomain.com/shop/view/shop1, mydomain.com/shop/view/shop2, ...
1
vote
1answer
931 views

.htaccess RewriteRule $1 contains wrong value

I have a RewriteRule that is not behaving as I expect. I want site.com/author/fred to map to site.com/author/index.php?a=fred I have an author directory within the site root. The author directory ...
0
votes
1answer
110 views

Prevent hotlinking of attachments

People are able to embed my forum's attachments (vbulletin). I tried to create an htaccess rule for the hotlinking, but it did not work. RewriteCond %{HTTP_REFERER} !^$ RewriteCond %{HTTP_REFERER} ...
0
votes
1answer
120 views

Why Google indexing blog.mywebsite.com instead of www.mywebsite.com?

All subdomains works in my website, example this: mywebsite.com www.mywebsite.com blog.mywebsite.com feed.mywebsite.com anything.mywebsite.com But Google indexed some of my website pages with ...
2
votes
1answer
554 views

403 error with a 301 redirect in .htaccess

I wrote a rewrite rule for one of my pages. This rule is supposed to be for a specific single URL only hence the "static-ness". RewriteRule ^picks/categorizedPicks/126$ ...
0
votes
1answer
130 views

Rewriting isn't doing what's expected

I've got a simple web.py application, running at Dreamhost. The .htaccess file, per the DH documentation is in the example.com home directory, not public: Options +ExecCGI AddHandler cgi-script .py ...
1
vote
1answer
572 views

URL redirection to same domain on different server

We have existing domain on non-IIS server and now we have moved it to IIS server. Client want us to redirect the URL from existing server to new server with same domain name. We will modify the ...
0
votes
1answer
650 views

.htaccess 301 rewrite rule not working

I had made the page the-book.html in wordpress site, later changed the name to about-the-book, now i have written the .htaccess file as **RewriteRule ^the-book.html$ ...
2
votes
1answer
90 views

What's the “^” in RewriteRule Statements?

I keep seeing the ^ character in RewriteRule statements in a context that doesn't fit with the usage specified here. For example: RewriteRule ^(.*)$ $1.php [L,QSA] What does it signify?
1
vote
2answers
173 views

Rewrite Issue on index.html

I have index.html on my html_directory on my website also I entered a rule as follows: RewriteRule ^index.html$ newindex.php It seems requests to my site is routing to my index.html file , my ...
0
votes
1answer
72 views

Redirect does not work

I tried to redirect a broken link onto my site by redirect : RewriteCond %{HTTP_HOST} ^.*$ RewriteRule ^domian_registration\.html$ "http\:\/\/mysite\.com\/domain_registration\.html" [R=301,L] But ...
2
votes
1answer
216 views

How to come back to old URL already redirected with 301? What is the impact to SEO?

I have recently moved my old site (built with DreamWeaver) to a new one (with new design and using WordPress). It was done last August, 1st and as the URLs with WP changed completely, I had to do ...
3
votes
1answer
15k 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 (.*) ...
0
votes
1answer
170 views

Is it possible to limit user access to folders using HTACCESS?

Is it possible to limit user access using a HTACCESS file? I'm not quite sure how to edit folder permissions with the host i'm with so I figure using an HTACCESS file might be easier.
1
vote
1answer
678 views

Can Apache “Correct” URL Case?

Let's say I keep every word of file names capitalized. For example, Home.php or MultipleWordTitle.html. Is there any way for Apache to redirect requests for incorrectly-cased URLs to the capitalized ...
1
vote
1answer
287 views

How to point two domains to one ip address with a sub-domain

I am a little stuck here I currently have a domain: www.my-site.org & m.my-site.org I want to point m.mainsite.org to m.my-site.org I already have an A record created for m.mainsite.org I need ...
1
vote
1answer
381 views

how can I set my site root from: localhost/mysite/ to: localhost/mysite/view/ via htaccess

hi just wondering if this is possible, when you access my default site directory localhost/mysite I want to set the path to render localhost/mysite/view/ all my html pages will be rendered here just ...
0
votes
1answer
105 views

seo htaccess 301 redirect

Have an SEO question. I have been checking the progress of my site indexing in Google, for some bizarre reason best known to itself, there is a very random URL indexed against my domain which doesnt ...
-2
votes
2answers
2k views

Having trouble redirecting old product sites and categories to new pages

I recently upgraded a shopsystem to prestashop and imported the previous products (~1200), and I managed to keep the old category_id and product_id. I'm trying to set up those 2 rules to redirect all ...
0
votes
1answer
488 views

Htaccess 404 & 301

The site is run on wordpress (latest) and is installed in /htdocs/www/ This htaccess file is in /htdocs/www/roh/ along with a bunch of images & some css. I want requests to the old html files to ...
1
vote
1answer
554 views

Setting up a redirect from 'www.example.com' to 'www.mysite.com/blog'

hopefully someone can give me a roadmap to get this done. I run a self-hosted Wordpress blog at http://www.example.com which has numerous posts/links such as ...
3
votes
3answers
1k views

Joomla 1.5 to Wordpress 3.1 migration: how to redirect Joomla's permalinks

I'm migrating a Joomla 1.5 site to a WordPress 3.1 site (I will later update to WP 3.2.x) and I've found the right tool to do it, a plugin called Joomla 1.5 Importer. There is another plugin called ...
1
vote
1answer
404 views

Read data from a folder in main domain folder (CPanel\WHM)

I have defined a host in my CPanel\WHM server and put all my websites under one host account. The host Main Domain is domain.com, and all other websites are Add-on Domains: domain.com --folder ...
1
vote
1answer
265 views

Redirect directory URL to instead have .html suffix

htaccess redirect (301) all my old content from my WordPress to my new URL design. I want to redirect all the last trailing slashes to .html ... the permalinks are already working, but I don't want ...
0
votes
1answer
167 views

I have 2 domains one main, one parked. I recently switched but host provider told me theyd repoint the DNS but there are problems? Do it via DS

I wanted to switch my site from www.mutantspace.ie to www.mutantspace.com. Up until now the .com was my parked domain. I looked into it and was told that using this code in my .htaccess file in ...