Htaccess files problems

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Htaccess files problems

Postby jonathanjooped » 11. April 2007 14:23

s
Last edited by jonathanjooped on 23. March 2011 23:52, edited 1 time in total.
jonathanjooped
 
Posts: 10
Joined: 11. April 2007 14:14
Location: UK

Postby Wiedmann » 11. April 2007 14:30

but it isn't working in XAMP

Why not, what happens?
Wiedmann
AF Moderator
 
Posts: 17106
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Postby jonathanjooped » 11. April 2007 14:40

The page says the following:

Object not found!

The requested URL was not found on this server. The link on the referring page seems to be wrong or outdated. Please inform the author of that page about the error.

If you think this is a server error, please contact the webmaster.
Error 404
localhost
04/11/07 14:41:20
Apache/2.2.4 (Win32) DAV/2 mod_ssl/2.2.4 OpenSSL/0.9.8d mod_autoindex_color PHP/5.2.1
jonathanjooped
 
Posts: 10
Joined: 11. April 2007 14:14
Location: UK

Postby Wiedmann » 11. April 2007 14:46

"error.log"?
Wiedmann
AF Moderator
 
Posts: 17106
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Postby jonathanjooped » 11. April 2007 14:53

Sorry forgot that also:

[Wed Apr 11 14:12:32 2007] [alert] [client 127.0.0.1] C:/xampp/htdocs/jooped/web/.htaccess: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration
[Wed Apr 11 14:12:36 2007] [alert] [client 127.0.0.1] C:/xampp/htdocs/jooped/web/.htaccess: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration
[Wed Apr 11 14:12:49 2007] [alert] [client 127.0.0.1] C:/xampp/htdocs/jooped/web/.htaccess: Invalid command 'RewriteRule', perhaps misspelled or defined by a module not included in the server configuration
[Wed Apr 11 14:13:01 2007] [alert] [client 127.0.0.1] C:/xampp/htdocs/jooped/web/.htaccess: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration


Again thanks.
jonathanjooped
 
Posts: 10
Joined: 11. April 2007 14:14
Location: UK

Postby Wiedmann » 11. April 2007 14:59

[Wed Apr 11 14:12:32 2007] [alert] [client 127.0.0.1] C:/xampp/htdocs/jooped/web/.htaccess: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration

Hm, with this log the error should be "Error 500" and not "Error 404"...

BTW:
You have to enable mod_rewrite in "httpd.conf" (LoadModule ...) if you want use it.
Wiedmann
AF Moderator
 
Posts: 17106
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Postby jonathanjooped » 11. April 2007 15:15

I had tried that because of reading the other post... I have also restarted apatche. Is the config file: C:\xampp\apache\conf\httpd.conf as that is what I edited.

It is saying error 500 now though.
jonathanjooped
 
Posts: 10
Joined: 11. April 2007 14:14
Location: UK

Postby Wiedmann » 11. April 2007 15:23

I had tried that

What have you done exactly?

I have also restarted apatche.

Correct. Restart Apache after every change in the config file.

Is the config file: C:\xampp\apache\conf\httpd.conf as that is what I edited.

Correct.

It is saying error 500 now though.

After/before your change?
The same message as above?
Wiedmann
AF Moderator
 
Posts: 17106
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Postby jonathanjooped » 11. April 2007 15:56

I changed:
#LoadModule rewrite_module modules/mod_rewrite.so

To:
LoadModule rewrite_module modules/mod_rewrite.so


I then saved it, restarted and the error is now Error 500 looking back at the page.

The log file now reads:
[Wed Apr 11 15:11:53 2007] [alert] [client 127.0.0.1] C:/xampp/htdocs/jooped/web/.htaccess: RewriteBase: argument is not a valid URL, referer: http://localhost/jooped/web/
[Wed Apr 11 15:11:54 2007] [alert] [client 127.0.0.1] C:/xampp/htdocs/jooped/web/.htaccess: RewriteBase: argument is not a valid URL
[Wed Apr 11 15:12:08 2007] [alert] [client 127.0.0.1] C:/xampp/htdocs/jooped/web/.htaccess: RewriteBase: argument is not a valid URL
jonathanjooped
 
Posts: 10
Joined: 11. April 2007 14:14
Location: UK

Postby Wiedmann » 11. April 2007 16:30

RewriteBase: argument is not a valid URL,

jonathanjooped wrote:
Code: Select all
RewriteBase ../

It says: "../" is not allowed.
IMHO this must be an absolute URI and not a relative.
Wiedmann
AF Moderator
 
Posts: 17106
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Postby jonathanjooped » 11. April 2007 16:54

Sorry... it should have been just
/
rather than
../
.

It is now displaying:
Object not found!

The requested URL was not found on this server. If you entered the URL manually please check your spelling and try again.

If you think this is a server error, please contact the webmaster.
Error 404
localhost
04/11/07 16:51:50
Apache/2.2.4 (Win32) DAV/2 mod_ssl/2.2.4 OpenSSL/0.9.8d mod_autoindex_color PHP/5.2.1


it is still saying:
[Sat Mar 31 02:57:41 2007] [alert] [client 127.0.0.1] C:/xampp/htdocs/.htaccess: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration, referer: http://localhost/
[Sat Mar 31 02:57:48 2007] [alert] [client 127.0.0.1] C:/xampp/htdocs/.htaccess: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration, referer: http://localhost/
jonathanjooped
 
Posts: 10
Joined: 11. April 2007 14:14
Location: UK

Postby Wiedmann » 11. April 2007 17:08

It is now displaying:
Error 404
04/11/07 16:51:50

it is still saying:
[Sat Mar 31 02:57:41 2007] [alert] [client 127.0.0.1] C:/xampp/htdocs/.htaccess: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration, referer: http://localhost/

This log entry can't be from this access (wrong time / wrong error code)
Wiedmann
AF Moderator
 
Posts: 17106
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Postby jonathanjooped » 11. April 2007 19:50

Sorry I included the wrong one:

I changed:
RewriteRule ^work/?$ work.php [L]

to
RewriteRule ^work/?$ jooped/web/work.php [L]


that then worked at:
http://localhost/jooped/web/work/

But on my live web version it didn't need that and all the code was the same.
Here is the old error code without the above change:
[Wed Apr 11 17:47:16 2007] [error] [client 127.0.0.1] script 'C:/xampp/htdocs/work.php' not found or unable to stat, referer: http://localhost/jooped/web/


Its like its not looking through the folders, the htaccess file is located at:
http://localhost/jooped/web/

Its really odd how one can work and another wont.
jonathanjooped
 
Posts: 10
Joined: 11. April 2007 14:14
Location: UK

Postby jonathanjooped » 11. April 2007 19:55

Fixed it I changed the RewriteBase:
RewriteBase /jooped/web/

Do I have to use that or can it not detect where it is and rewrite without it?

Thanks for all your help though.
You have helped get me through errors and things.
Cheers
Jonathan
jonathanjooped
 
Posts: 10
Joined: 11. April 2007 14:14
Location: UK

Postby Wiedmann » 11. April 2007 19:58

Do I have to use that or can it not detect where it is and rewrite without it?

This depends on the filesystem location of the .htaccess with the ReWrite rules.
Wiedmann
AF Moderator
 
Posts: 17106
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Next

Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 56 guests