apache - Unable to enable .htaccess or its not working -
i have setup condeigniter installation , inorder remove index.php url,i have configured .htaccess file.but not working.the .htaccess file not working.i tested adding irrelevent data in files , didnt throw errors.
this following configuration in httpd.conf file
<directory/> options followsymlinks allowoverride order deny,allow deny satisfy </directory>
in htaccess file have added 'deny all' , still allowing access directory.
can me on how enable .htaccess ?
pls find config file below
# # dynamic shared object (dso) support # # able use functionality of module built dso # have place corresponding `loadmodule' lines @ location # directives contained in available _before_ used. # statically compiled modules (those listed `httpd -l') not need # loaded here. # # example: # loadmodule foo_module modules/mod_foo.so # loadmodule auth_basic_module modules/mod_auth_basic.so loadmodule auth_digest_module modules/mod_auth_digest.so loadmodule authn_file_module modules/mod_authn_file.so loadmodule authn_alias_module modules/mod_authn_alias.so loadmodule authn_anon_module modules/mod_authn_anon.so loadmodule authn_dbm_module modules/mod_authn_dbm.so loadmodule authn_default_module modules/mod_authn_default.so loadmodule authz_host_module modules/mod_authz_host.so loadmodule authz_user_module modules/mod_authz_user.so loadmodule authz_owner_module modules/mod_authz_owner.so loadmodule authz_groupfile_module modules/mod_authz_groupfile.so loadmodule authz_dbm_module modules/mod_authz_dbm.so loadmodule authz_default_module modules/mod_authz_default.so loadmodule ldap_module modules/mod_ldap.so loadmodule authnz_ldap_module modules/mod_authnz_ldap.so loadmodule include_module modules/mod_include.so loadmodule log_config_module modules/mod_log_config.so loadmodule logio_module modules/mod_logio.so loadmodule env_module modules/mod_env.so loadmodule ext_filter_module modules/mod_ext_filter.so loadmodule mime_magic_module modules/mod_mime_magic.so loadmodule expires_module modules/mod_expires.so loadmodule deflate_module modules/mod_deflate.so loadmodule headers_module modules/mod_headers.so loadmodule usertrack_module modules/mod_usertrack.so loadmodule setenvif_module modules/mod_setenvif.so loadmodule mime_module modules/mod_mime.so loadmodule dav_module modules/mod_dav.so loadmodule status_module modules/mod_status.so loadmodule autoindex_module modules/mod_autoindex.so loadmodule info_module modules/mod_info.so loadmodule dav_fs_module modules/mod_dav_fs.so loadmodule vhost_alias_module modules/mod_vhost_alias.so loadmodule negotiation_module modules/mod_negotiation.so loadmodule dir_module modules/mod_dir.so loadmodule actions_module modules/mod_actions.so loadmodule speling_module modules/mod_speling.so loadmodule userdir_module modules/mod_userdir.so loadmodule alias_module modules/mod_alias.so loadmodule substitute_module modules/mod_substitute.so loadmodule rewrite_module modules/mod_rewrite.so loadmodule proxy_module modules/mod_proxy.so loadmodule proxy_balancer_module modules/mod_proxy_balancer.so loadmodule proxy_ftp_module modules/mod_proxy_ftp.so loadmodule proxy_http_module modules/mod_proxy_http.so loadmodule proxy_ajp_module modules/mod_proxy_ajp.so loadmodule proxy_connect_module modules/mod_proxy_connect.so loadmodule cache_module modules/mod_cache.so loadmodule suexec_module modules/mod_suexec.so loadmodule disk_cache_module modules/mod_disk_cache.so loadmodule cgi_module modules/mod_cgi.so loadmodule version_module modules/mod_version.so # # following modules not loaded default: # #loadmodule asis_module modules/mod_asis.so #loadmodule authn_dbd_module modules/mod_authn_dbd.so #loadmodule cern_meta_module modules/mod_cern_meta.so #loadmodule cgid_module modules/mod_cgid.so #loadmodule dbd_module modules/mod_dbd.so #loadmodule dumpio_module modules/mod_dumpio.so #loadmodule filter_module modules/mod_filter.so #loadmodule ident_module modules/mod_ident.so #loadmodule log_forensic_module modules/mod_log_forensic.so #loadmodule unique_id_module modules/mod_unique_id.so #loadmodule file_cache_module modules/mod_file_cache.so # # # load config files config directory "/etc/httpd/conf.d". # include conf.d/*.conf # # extendedstatus controls whether apache generate "full" status # information (extendedstatus on) or basic information (extendedstatus # off) when "server-status" handler called. default off. # #extendedstatus on # # if wish httpd run different user or group, must run # httpd root , switch. # # user/group: name (or #number) of user/group run httpd as. # . on sco (odt 3) use "user nouser" , "group nogroup". # . on hpux may not able use shared memory nobody, , # suggested workaround create user www , use user. # note kernels refuse setgid(group) or semctl(ipc_set) # when value of (unsigned)group above 60000; # don't use group #-1 on these systems! # user apache group apache ### section 2: 'main' server configuration # # directives in section set values used 'main' # server, responds requests aren't handled # <virtualhost> definition. these values provide defaults # <virtualhost> containers may define later in file. # # of these directives may appear inside <virtualhost> containers, # in case these default settings overridden # virtual host being defined. # # # serveradmin: address, problems server should # e-mailed. address appears on server-generated pages, such # error documents. e.g. admin@your-domain.com # serveradmin root@localhost # # servername gives name , port server uses identify itself. # can determined automatically, recommend specify # explicitly prevent problems during startup. # # if not set valid dns name host, server-generated # redirections not work. see usecanonicalname directive. # # if host doesn't have registered dns name, enter ip address here. # have access address anyway, , make # redirections work in sensible way. # #servername www.example.com:80 # # usecanonicalname: determines how apache constructs self-referencing # urls , server_name , server_port variables. # when set "off", apache use hostname , port supplied # client. when set "on", apache use value of # servername directive. # usecanonicalname off # # documentroot: directory out of serve # documents. default, requests taken directory, # symbolic links , aliases may used point other locations. # documentroot "/var/www/html" # # each directory apache has access can configured respect # services , features allowed and/or disabled in # directory (and subdirectories). # # first, configure "default" restrictive set of # features. # <directory /> options followsymlinks allowoverride order deny,allow deny satisfy </directory> # # note point forward must allow # particular features enabled - if something's not working # might expect, make sure have enabled # below. # # # should changed whatever set documentroot to. # <directory "/var/www/html"> # # possible values options directive "none", "all", # or combination of: # indexes includes followsymlinks symlinksifownermatch execcgi multiviews # # note "multiviews" must named *explicitly* --- "options all" # doesn't give you. # # options directive both complicated , important. please see # http://httpd.apache.org/docs/2.2/mod/core.html#options # more information. # options indexes followsymlinks # # allowoverride controls directives may placed in .htaccess files. # can "all", "none", or combination of keywords: # options fileinfo authconfig limit # allowoverride none # # controls can stuff server. # order allow,deny allow </directory> # # userdir: name of directory appended onto user's home # directory if ~user request received. # # path end user account 'public_html' directory must # accessible webserver userid. means ~userid # must have permissions of 711, ~userid/public_html must have permissions # of 755, , documents contained therein must world-readable. # otherwise, client receive "403 forbidden" message. # # see also: http://httpd.apache.org/docs/misc/faq.html#forbidden # <ifmodule mod_userdir.c> # # userdir disabled default since can confirm presence # of username on system (depending on home directory # permissions). # userdir disabled # # enable requests /~user/ serve user's public_html # directory, remove "userdir disabled" line above, , uncomment # following line instead: # #userdir public_html </ifmodule> # # control access userdir directories. following example # site these directories restricted read-only. # #<directory /home/*/public_html> # allowoverride fileinfo authconfig limit # options multiviews indexes symlinksifownermatch includesnoexec # <limit post options> # order allow,deny # allow # </limit> # <limitexcept post options> # order deny,allow # deny # </limitexcept> #</directory> # # directoryindex: sets file apache serve if directory # requested. # # index.html.var file (a type-map) used deliver content- # negotiated documents. multiviews option can used # same purpose, slower. # directoryindex index.html index.html.var # # accessfilename: name of file in each directory # additional configuration directives. see allowoverride # directive. # accessfilename .htaccess # # following lines prevent .htaccess , .htpasswd files being # viewed web clients. # <files ~ "^\.ht"> order allow,deny deny satisfy </files> # # typesconfig describes mime.types file (or equivalent) # found. # typesconfig /etc/mime.types # # defaulttype default mime type server use document # if cannot otherwise determine one, such filename extensions. # if server contains text or html documents, "text/plain" # value. if of content binary, such applications # or images, may want use "application/octet-stream" instead # keep browsers trying display binary files though # text. # defaulttype text/plain # # mod_mime_magic module allows server use various hints # contents of file determine type. mimemagicfile # directive tells module hint definitions located. # <ifmodule mod_mime_magic.c> # mimemagicfile /usr/share/magic.mime mimemagicfile conf/magic </ifmodule> # # hostnamelookups: log names of clients or ip addresses # e.g., www.apache.org (on) or 204.62.129.132 (off). # default off because it'd overall better net if people # had knowingly turn feature on, since enabling means # each client request result in @ least 1 lookup request # nameserver. # hostnamelookups off # # enablemmap: control whether memory-mapping used deliver # files (assuming underlying os supports it). # default on; turn off if serve nfs-mounted # filesystems. on systems, turning off (regardless of # filesystem) can improve performance; details, please see # http://httpd.apache.org/docs/2.2/mod/core.html#enablemmap # #enablemmap off # # enablesendfile: control whether sendfile kernel support # used deliver files (assuming os supports it). # default on; turn off if serve nfs-mounted # filesystems. please see # http://httpd.apache.org/docs/2.2/mod/core.html#enablesendfile # #enablesendfile off # # errorlog: location of error log file. # if not specify errorlog directive within <virtualhost> # container, error messages relating virtual host # logged here. if *do* define error logfile <virtualhost> # container, host's errors logged there , not here. # errorlog logs/error_log # # loglevel: control number of messages logged error_log. # possible values include: debug, info, notice, warn, error, crit, # alert, emerg. # loglevel warn # # following directives define format nicknames use # customlog directive (see below). # logformat "%h %l %u %t \"%r\" %>s %b \"%{referer}i\" \"%{user-agent}i\"" combined logformat "%h %l %u %t \"%r\" %>s %b" common logformat "%{referer}i -> %u" referer logformat "%{user-agent}i" agent # "combinedio" includes actual counts of actual bytes received (%i) , sent (%o); # requires mod_logio module loaded. #logformat "%h %l %u %t \"%r\" %>s %b \"%{referer}i\" \"%{user-agent}i\" %i %o" combinedio # # location , format of access logfile (common logfile format). # if not define access logfiles within <virtualhost> # container, logged here. contrariwise, if *do* # define per-<virtualhost> access logfiles, transactions # logged therein , *not* in file. # #customlog logs/access_log common # # if have separate agent , referer logfiles, uncomment # following directives. # #customlog logs/referer_log referer #customlog logs/agent_log agent # # single logfile access, agent, , referer information # (combined logfile format), use following directive: # customlog logs/access_log combined # # optionally add line containing server version , virtual host # name server-generated pages (internal error documents, ftp directory # listings, mod_status , mod_info output etc., not cgi generated # documents or custom error documents). # set "email" include mailto: link serveradmin. # set 1 of: on | off | email # serversignature on # # aliases: add here many aliases need (with no limit). format # alias fakename realname # # note if include trailing / on fakename server # require present in url. "/icons" isn't aliased in # example, "/icons/". if fakename slash-terminated, # realname must slash terminated, , if fakename omits # trailing slash, realname must omit it. # # include /icons/ alias fancyindexed directory listings. if # not use fancyindexing, may comment out. # alias /icons/ "/var/www/icons/" <directory "/var/www/icons"> options indexes multiviews followsymlinks allowoverride none order allow,deny allow </directory> # # webdav module configuration section. # <ifmodule mod_dav_fs.c> # location of webdav lock database. davlockdb /var/lib/dav/lockdb </ifmodule> # # scriptalias: controls directories contain server scripts. # scriptaliases same aliases, except # documents in realname directory treated applications , # run server when requested rather documents sent client. # same rules trailing "/" apply scriptalias directives # alias. # scriptalias /cgi-bin/ "/var/www/cgi-bin/" # # "/var/www/cgi-bin" should changed whatever scriptaliased # cgi directory exists, if have configured. # <directory "/var/www/cgi-bin"> allowoverride none options none order allow,deny allow </directory> # # redirect allows tell clients documents used exist in # server's namespace, not anymore. allows tell # clients relocated document. # example: # redirect permanent /foo http://www.example.com/bar # # directives controlling display of server-generated directory listings. # # # indexoptions: controls appearance of server-generated directory # listings. # indexoptions fancyindexing versionsort namewidth=* htmltable charset=utf-8 # # addicon* directives tell server icon show different # files or filename extensions. these displayed # fancyindexed directories. #
go httpd.conf in c:\apache24\conf
step 1
replace line
#loadmodule rewrite_module modules/mod_rewrite.s
with
loadmodule rewrite_module modules/mod_rewrite.s
step 2
replace line
allowoverride none
with
allowoverride
Comments
Post a Comment