Error flagged in .htaccess file
Posted by: SimonT (---.lightspeed.stlsmo.sbcglobal.net)
Date: May 15, 2016 08:02AM

This issue relates to an installation using wampserver3.0.4_x64_apache2.4.18_mysql5.7.11_php5.6.19-7.0.4.exe and all of the C++ redist libs, as specified on the information page of the install. It was installed about two hours ago.

The only installation default I changed was to specify Firefox to replace IE.

I created a virtual host successfully after a bit of help -thank you, RiggsFolly

When I use the link to it on the localhost page, Apache logs this error:

[Sat May 14 23:55:27.581008 2016] [core:alert] [pid 3764:tid 884] [client 127.0.0.1:51306] C:/wamp64/www/bobroot/.htaccess: Invalid command 'Header', perhaps misspelled or defined by a module not included in the server configuration


The contents of my .htaccess file are:

---------------------------------
ErrorDocument 404 "404 page not found"


AddType text/x-server-parsed-html .html


Header append X-FRAME-OPTIONS "SAMEORIGIN"
RewriteEngine on
RewriteCond %{THE_REQUEST} \/index.shtml\ HTTP [NC]
RewriteRule (.*)index.shtml$ /$1 [R=301,L]
RewriteCond %{THE_REQUEST} \/index.html\ HTTP [NC]
RewriteRule (.*)index.html$ /$1 [R=301,L]
RewriteCond %{HTTP_HOST} !^www.bobnovell.com$
RewriteRule ^(.*)$ [www.bobnovell.com] [R=301]
------------------------------------

Why is this error occurring, the same .htaccess file is in use, successfully, on a hosting company's server.

What configuration changes need to be changed or added to support Header?

Options: ReplyQuote
Re: Error flagged in .htaccess file
Posted by: SimonT (---.lightspeed.stlsmo.sbcglobal.net)
Date: May 15, 2016 08:08AM

Forgot to say - those rewrites need to be changed, I noticed that when I looked at the file.

I'll recreate the file and fix the rewrites before going any further.

Options: ReplyQuote
Re: Error flagged in .htaccess file
Posted by: Otomatic (Moderator)
Date: May 15, 2016 10:28AM

Hi,

I think you have to validate :
- Wampmanager Icon -> Apache -> Apache modules -> headers_module

What is noted with the error?
> Invalid command 'Header', perhaps misspelled or defined by a module not included in the server configuration

When you have that kind of mistake, the best thing is to go to the related documentation (Links are in the signatures of RiggsFolly and myself).
And, for example, the directive header that reads? => Module: mod_headers

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons



Edited 1 time(s). Last edit at 05/15/2016 11:04AM by Otomatic.

Options: ReplyQuote
Re: Error flagged in .htaccess file
Posted by: SimonT (---.lightspeed.stlsmo.sbcglobal.net)
Date: May 16, 2016 06:29AM

Your said"

"I think you have to validate :
- Wampmanager Icon -> Apache -> Apache modules -> headers_module"

As a native English speaker, I would say

"Check your settings and make sure that headers_module is checked in WampmanagerIcon -> Apache -> Apache modules -> headers_module"

I am not criticizing your English - your English is much better than my French, which is almost nonexistent.

I just wanted to point out that, in English, 'validate' and 'check' both mean the same but when used in this context, 'make sure' will be much more understandable. Also, when referring to a menu item or checkbox, you would say it is "checked" or "not checked" instead of using validate, validated, or not validated.

Hope this helps.

My French is limited to what I've heard on television and in the movies or have read on restaurant menus and I doubt my spellings of the words I do know would be correct. I just thought I'd take a moment to give you some more useful wordings for some phrases.
-------------

As to my problem -

I have confirmed that headers_module is checked in the Apache module list ("confirmed" is a preferable way to say "validated" in English in this sort of usage)

I still get the same error about the Header line.

Any ideas as to why this is happening?

Options: ReplyQuote
Re: Error flagged in .htaccess file
Posted by: Otomatic (Moderator)
Date: May 16, 2016 10:24AM

Hi,

> RewriteCond %{HTTP_HOST} !^www.bobnovell.com$
> RewriteRule ^(.*)$ [www.bobnovell.com] [R=301]

Maybe not use the URL of the actual site in local use.

Do you confirm that rewrite_module is checked in the Apache module list?

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote


Sorry, only registered users may post in this forum.