Forum Moderators: phranque
So I've installed it and got PHP working, but I'm having difficulties getting it to work like it does with my web hoster's apache server. I've been fiddling with the httpd.conf file, but a lot of it is gibberish to me and I'm sure I'm missing something.
This is the .htaccess file that all works on my hosts server:
AddHandler cgi-script .wow
DirectoryIndex home.wow
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_URI}!/$
RewriteCond %{REQUEST_FILENAME}.wow -f
RewriteRule ^(.*) $1\.wow [L]
RewriteRule ^home_(.*)$ home?theme=$1
RewriteRule ^services_(.*)$ services?theme=$1
RewriteRule ^recent_work_(.*)$ recent_work?theme=$1
RewriteRule ^vision_(.*)$ vision?theme=$1
RewriteRule ^contact_(.*)$ contact?theme=$1
RewriteRule ^t_and_c_(.*)$ t_and_c?theme=$1
So I need to know what to change/add to my httpd.conf file to:
1. enable me to parse a random file extension (.wow) as php
2. get mod_rewrite working
What I have already altered in my httpd.conf file is:
a. activated
LoadModule rewrite_module modules/mod_rewrite.so
b. added
LoadModule php4_module "D:\PHP\php-4.3.6-Win32\sapi\php4apache2.dll"
AddType application/x-httpd-php .php
c. added
DirectoryIndex index.html index.html.var index.php home.php
d. added
Indexes ExecCGI
to
<Directory "D:/Program Files/Apache Group/Apache2/cgi-bin">
AllowOverride None
Options Indexes ExecCGI
Order allow,deny
Allow from all
</Directory>
Also will I have to add anything else to my offline .htaccess file.
Thanks in advance,
R
httpd.conffile:
#
# 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
#
# AccessFileName: The name of the file to look for in each directory
# for additional configuration directives. See also the AllowOverride
# directive.
#
AccessFileName .htaccess
#
# The following lines prevent .htaccess and .htpasswd files from being
# viewed by Web clients.
#
<Files ~ "^\.ht">
Order allow,deny
Deny from all
</Files>
AllowOverride [httpd.apache.org] Nonebut you may want to click that link and read more before you set the value to
All. I'm not saying you are at risk running your server that way but you really should read up on all that you are allowing at this point.
AddHandler cgi-script .wowWell, you shouldn't need the AddHandler [httpd.apache.org] directive. I noticed you are using a Windows installation and it looks like you are using PHP as an Apache module. Once that has been put into your
httpd.confor
.htaccessfile, any file containing the
.wowextension will be treated as a CGI program.
Simply use an AddType and you will be able to parse pages with a
.wowextension as PHP.
AddType application/x-httpd-php .wow