Using Mod_Rewrite with Xampp and Windows 7 - 64 Bit

perl 5.12 64bit with xampp

It's been a while since I looked at XAMPP on Windows (Stackers, edits/improvements welcome). IIRC one only needed to change the registry key for the ScriptInterpreterSource directive. You can install a non-crippled distro like Strawberry Perl (comes with dmake) and point the configuration or shebang lines to the location of its perl binary. You can then simply ignore the XAMPP Perl. I do not know what to do to integrate mod_perl2 (no httpd headers/apxs available? please verify).

Remember that XAMPP is designed to give novice users a development environment and an initial foothold so that they can get stuff done and a quick first sense of achievement, at the cost of flexibility in the software setup. If you then find yourself restricted by the choices made by the "Apache friends" dev group, you should move off and learn how to set up the toolchain of httpd/perl/mod_perl yourself. This is eventually necessary anyway because you need a hardened production environment facing the real Web, which XAMPP is not suitable for.

Access forbidden! xampp windows 7

Just after creating a question and reviewing, I had noticed in httpd.conf the Directory tag and there was

Required all denied

I changed to

Require all granted

and it started working.

clean URL test failed D7

I don't know if you still need help, but I spent good amount of time trying to figure that out myself a while ago and couldn't find the right answer. After doing a lot of trial and error, I made it work. I don't know exactly how your setup is but here is how mine is, as well as my solution on drupal.org.

(Here is a copy of a part of my original question and my complete solution)

Hi,

I have a Drupal multisite setup and I am trying to make the Clean URLs
work but cannot seem to be able to write the conditions and rules
properly. I have found many answers but none of them worked.

My .htaccess file is being read without problem and the rules are
being used (I tried setting the rewrite rule to the full address but
it was only giving me the home page and I couldn't go anywhere else).

Here is how it is setup:

DEV: URL1 www.site1.domain.fr/dev

         URL2 www.site2.site1.domain.fr/dev

PROD URL1 www.site1.domain.fr

           URL2 www.site2.site1.domain.fr

On the server: /dev (one drupal install)

                       /prod (another drupal install
but same content)

My multisite is setup as this:

/sites/site1.domain.fr

/sites/site2.site1.domain.fr (same thing for dev and for prod)

Inside sites.php:

$sites = array( 
'www.site1.domain.fr' => 'site1.domain.fr',
'www.site2.site1.domain.fr' => 'site2.site1.domain.fr', )



Solution

I was finally able to fix it by trial and error. In case any of you
encounter the same problem, here is how I fixed it:

DEV: 

RewriteBase /dev

# Main site
RewriteCond %{HTTP_HOST} ^site1\.domain\.fr [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ site1.domain.fr/dev/index.php?q=$1 [L,QSA]

# Site 2
RewriteCond %{HTTP_HOST} ^site2.site1\.domain\.fr [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ site2.site1.domain.fr/dev/index.php?q=$1 [L,QSA]

PROD:

RewriteBase /

# Main site
RewriteCond %{HTTP_HOST} ^site1\.domain\.fr [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ site1.domain.fr/index.php?q=$1 [L,QSA]

# Site 2
RewriteCond %{HTTP_HOST} ^site2.site1\.domain\.fr [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ site2.site1.domain.fr/index.php?q=$1 [L,QSA]


Related Topics



Leave a reply



Submit