Page 1 of 1

Can anyone please help get htaccess working

PostPosted: 01. July 2013 23:41
by parterin
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.

Re: Can anyone please help get htaccess working

PostPosted: 02. July 2013 00:08
by parterin
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:)

Re: Can anyone please help get htaccess working

PostPosted: 02. July 2013 00:27
by Altrea
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.

Re: Can anyone please help get htaccess working

PostPosted: 02. July 2013 01:53
by parterin
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.

Re: Can anyone please help get htaccess working

PostPosted: 02. July 2013 02:08
by Altrea
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.