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
link|improve this question

71% accept rate
feedback

1 Answer

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.

link|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
feedback

Your Answer

 
or
required, but never shown

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