Topic: .htacess issues (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=30124" title="Pages that link to Topic: .htacess issues (Page 1 of 1)" rel="nofollow" >Topic: .htacess issues <span class="small">(Page 1 of 1)</span>\

 
hbadami
Neurotic (0) Inmate
Newly admitted

From:
Insane since: Mar 2008

posted posted 03-17-2008 15:30

Hi

I am trying to use HtAccess wrappers with PHP tutorial. Unfortunately this doesnt work for me. All I am doing is just copying the zip file and extracting it to a test directory in htdocs. When I access the sample.html file, it only shows me the exact sample.html, doesnt embed header or footer.
I am using Apache Web server v 2.2.8 PHP / 5.2.5. Any reasons? I shall be highly obliged by any replies.

Tyberius Prime
Maniac (V) Mad Scientist with Finglongers

From: Germany
Insane since: Sep 2001

posted posted 03-17-2008 16:30

Helle hbadami,
welcome to the Asylum!

We'll need more information to be able to help you - so far we no you've downloaded a zip file from somewhere
and extracted it, and I'm a little unsure what you're trying to acomplish.

Are you trying to password protect your webpage?
Or are you trying to inject a php header & footer below every static html page in a directory?
What operating system are you working with?

So long,

->Tyberius Prime

hbadami
Obsessive-Compulsive (I) Inmate

From:
Insane since: Mar 2008

posted posted 03-17-2008 17:40

Hi

Sorry I forgot to put in the complete information.

I am trying to implement the concept of php wrapper as presented at http://www.webpronews.com/topnews/2004/04/29/htaccess-wrappers-with-php. I have followed the instructions there and downloaded the header package which injects an html header and footer to every static html page in the directory.

The problem comes in when I try to access the file sample.html. Ironically the header and footer are not included.

I am using Apache Web server v 2.2.8, PHP / 5.2.5 on windows XP version 2002, Service pack 2. Any help shall be highly appreciated.

Tyberius Prime
Maniac (V) Mad Scientist with Finglongers

From: Germany
Insane since: Sep 2001

posted posted 03-17-2008 18:18

"Upload all five files to your web host, chmod htaccess.txt to 0755 then rename it to ".htaccess""

How did you rename the file? Windows would usually complain about '.htaccess' not being a valid filename...
(The command line could do this).

hbadami
Obsessive-Compulsive (I) Inmate

From:
Insane since: Mar 2008

posted posted 03-17-2008 18:23

I copied the contents of a file to a new file using editplus and then saved it as .htaccess
If I go through cmd and do a dir, I can see the file as .htaccess

Tyberius Prime
Maniac (V) Mad Scientist with Finglongers

From: Germany
Insane since: Sep 2001

posted posted 03-17-2008 22:35

Hm, your apache is configured to allow .htaccess overwriting?
(Options +AllowOverwrite, I seem to remember)

CPrompt
Maniac (V) Inmate

From: there...no..there.....
Insane since: May 2001

posted posted 03-18-2008 02:04

so what happens when you go directly to the place where the header.php page is? does the header show at all?

From the .htaccess file given, it should be in /header/header.php
If you just extracted this and put it in a single directory, the header.php file will not be called because it is looking in a directory that doesn't exist.

Later,

C:\

hbadami
Obsessive-Compulsive (I) Inmate

From:
Insane since: Mar 2008

posted posted 03-18-2008 12:01

The folder structure is as follows
htdocs->header

In the header folder I have got all the files i.e. sample.html, header.php, header.html, footer.html, .htaccess

When I directly access header using the url http://localhost/header/header.php it shows:

This is my header
-------------------------------------------------------
-------------------------------------------------------
This is my footer

When I access sample.html using the url http://localhost/header/sample.html it shows

A sample page. The header and footer should appear on this page without actually putting them in this file.

The interesting thing is I used the same code on my remote server (linux based) it wrapps as expected. Seems to be a problem in the configuration of my local testing server. I tried phpinfo on server and the first thing I notice is the server api which is set to CGI on remote server but Apache 2.0 handler on my machine. Any clues?

Tyberius Prime
Maniac (V) Mad Scientist with Finglongers

From: Germany
Insane since: Sep 2001

posted posted 03-18-2008 12:17

Hm... I'm no expert in this and would have to tinker with the documentation....

make sure mod_mime is being loaded.

Blaise
Paranoid (IV) Inmate

From: London
Insane since: Jun 2003

posted posted 03-18-2008 12:28

I don't know anything about php or .htaccess files, but if it's anything like ASP shouldn't your sample.html be a php file? I'm assuming that in the sample.html file there are tags calling in the header and footer.



Post Reply
 
Your User Name:
Your Password:
Login Options:
 
Your Text:
Loading...
Options:


« BackwardsOnwards »

Show Forum Drop Down Menu