Can anyone please help get htaccess working

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

Can anyone please help get htaccess working

Postby parterin » 01. July 2013 23:41

Hi

Just installed version 1.7.7 on Windows XP, as the older version ceased to function. Good to be running to a degree but a problem with htaccess. Have tested with simple redirects etc. and definitely not functioning.

Did search and read what I could find on the forum. Have checked that in httpd.conf the following are uncommented:

LoadModule env_module modules/mod_env.so
LoadModule rewrite_module modules/mod_rewrite.so

The sites are in folders on the desktop, running via httpd-vhosts.conf with entries in the form:

<VirtualHost *>
DocumentRoot "C:\Documents and Settings\HP_Administrator\Desktop\sampledomain"
ServerName www.sampledomain.com
<Directory "C:\Documents and Settings\HP_Administrator\Desktop\sampledomain">
Order allow,deny
Allow from all
</Directory>
</VirtualHost>

Possibly not relevant but the type of htaccess entry we are trying to get working is:

<IfModule mod_rewrite.c>
<IfModule mod_env.c>
SetEnv gp_rewrite t765r63w
</IfModule>
RewriteEngine On
RewriteBase "/"
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
<IfModule mod_cache.c>
RewriteRule /?(.*) "/index.php/$1" [L]
</IfModule>
<IfModule !mod_cache.c>
RewriteRule . "/index.php" [L]
</IfModule>
</IfModule>

With this not functioning, image paths, urls etc are naturally wrong e.g. now sampledomain/index.php/page instead of sampledomain/page

Main thing is to know what I am doing wrong, or have missed. Any help is much appreciated.
parterin
 
Posts: 6
Joined: 01. July 2013 19:27
Operating System: Windows XP

Re: Can anyone please help get htaccess working

Postby parterin » 02. July 2013 00:08

For anyone with the same issue, seems to be solved. we copied the various config files and went through them, which led to changing line 195 in httpd.conf:

From: AllowOverride None

To: AllowOverride All

Had understood from other reading that the later allow rules overrode this but maybe not for our set up thinking about it. Hope this helps someone, obvious in a sense I guess, only excuse is being tired, many many hours to get xampp running.

A fantastic tool by the way and thanks to those who give their time, we just seem to struggle with the technical complexities but that's web builders for you. Not that we are that professional, a non profit unit building sites for local charities. About the only option in these times, none of us have any money:)
parterin
 
Posts: 6
Joined: 01. July 2013 19:27
Operating System: Windows XP

Re: Can anyone please help get htaccess working

Postby Altrea » 02. July 2013 00:27

parterin wrote:we copied the various config files and went through them, which led to changing line 195 in httpd.conf:

From: AllowOverride None

To: AllowOverride All

This is not a recommend change.
The <Directory /> Block defines the default behavior Apache has to act if no specific <Directory> Block overrides this setting.
This can be a security issue because now for any not specified folder a .htaccess file is able to override many many php settings.
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 8293
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 10 Pro x64

Re: Can anyone please help get htaccess working

Postby parterin » 02. July 2013 01:53

Thanks Altrea

A valuable security point and that's more or less what I understood, as in this being overridden by later entries. Trouble was we couldn't find another fix. In this case the installation is only used on a local machine behind a firewall, may be okay.

If you know another way to allow htaccess for virtual host root domains, will happily change.
parterin
 
Posts: 6
Joined: 01. July 2013 19:27
Operating System: Windows XP

Re: Can anyone please help get htaccess working

Postby Altrea » 02. July 2013 02:08

parterin wrote:If you know another way to allow htaccess for virtual host root domains, will happily change.

Adding AllowOverride All inside the <Directory> Block of your VirtualHost is the common way.
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 8293
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 10 Pro x64


Return to XAMPP for Windows

Who is online

Users browsing this forum: DrSeussFreak and 59 guests