Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I've got a set of webpages-A at www.example.com and I want to setup a set of scripts-B at the location: www.example.com/abc/

I've got an existing .htaccess which is "configured" to be located at an address like www.example.com/ (not within the subfolder)

Where should the .htaccess be located? At www.example.com/ or at www.example.com/abc/

Its currently at the latter, but its not redirecting properly.

How do I check if the url rewriting module is installed properly?


Edit 1: Solution

In /etc/httpd/conf/httpd.conf, changed:

# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
#   Options FileInfo AuthConfig Limit
#
    AllowOverride None

To

# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
#   Options FileInfo AuthConfig Limit
#
    AllowOverride All
share|improve this question

1 Answer 1

up vote 0 down vote accepted

You need to put your .htaccess file in the server folder abc - so you need to check the path to the root of your site, and then put the .htaccess in the abc folder in that root folder.

For example, /usr/local/apache2/htdocs/example_site_root/abc <- put .htaccess here.

share|improve this answer
    
darn - its actually there... so I guess the rewrite module isnt installed / working - how can I definitely check that? –  matt74tm Oct 20 '10 at 9:47
1  
You need to check whether your host directive allows .htaccess to override the httpd.conf settings - there should be a line with 'AllowOverride`. Check that your httpd.conf file has lines saying LoadModule rewrite_module modules/mod_rewrite.so and AddModule mod_rewrite.c and they aren't commented out. See also httpd.apache.org/docs/2.2/howto/htaccess.html –  dunxd Oct 20 '10 at 9:55
    
Ahh... I did the first. The second line was already present and I didnt need to do the third... (see edit 1) –  matt74tm Oct 20 '10 at 11:49

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.