Mod Rewrite Issue?

Irgendwelche Probleme mit XAMPP für Windows? Dann ist hier genau der richtige Ort um nachzufragen.

Mod Rewrite Issue?

Postby vaciliy » 02. May 2011 03:58

My first post, so please be patient.

I am using Win 7. I downloaded XAMPP 1.7.1. I had to change the http://localhost/ to http://localhost:8080/ as port 80 was already busy. In httpd.conf I changed AllowOverride to All.

I run a local website (php 4.2 and MySQL). The root directory of the website (located in E:\xampp\htdocs\test) contains an htaccess file.

I checked the php info to see that mod_rewrite is loaded. The htaccess file is also working correctly and is being picked up (I tried to enter nonsense text in the htaccess file and got a server error after that which confirms the htaccess is fine).

The website's home page loads fine, but it does not seem to pick up css or javascript files. The home page text and images having a direct url are shown, but any css styling isn't applied. In addition, any links to other pages just take me to http://localhost/xampp/.

I checked the error logs and they show this error (there are a lot of lines like this):

[Sun May 01 22:26:57 2011] [error] [client] File does not exist: E:/xampp/htdocs/scripts, referer: http://localhost:8080/test/.

The htaccess file is as follows (this file works great on the remove server):

RewriteEngine On

RewriteBase /

#Options +FollowSymLinks

<FilesMatch ".(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$">
Header set Expires "Thu, 15 Apr 2015 20:00:00 GMT"
Header set Cache-Control "max-age=172800, public, must-revalidate"

Header unset ETag
FileETag None

<IfModule mod_deflate.c>
SetOutputFilter DEFLATE
SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png|rar|zip|pdf)$ no-gzip dont-vary
<IfModule mod_headers.c>
Header append Vary User-Agent

<IfModule mod_expires.c>

# enable expirations
ExpiresActive On
ExpiresByType image/gif "access plus 7 days"
ExpiresByType image/jpeg "access plus 7 days"
ExpiresByType text/css "access plus 7 days"
ExpiresByType application/x-shockwave-flash "access plus 7 days"
ExpiresByType application/javascript "access plus 7 days"
ExpiresByType text/javascript "access plus 7 days"
ExpiresByType image/png "access plus 7 days"
<FilesMatch "\.(ico|gif|jpg|jpeg|png|flv|pdf)$">
Header append Cache-Control "public"
<FilesMatch "\.(js|css|swf)$">
ExpiresDefault "access plus 7 days"
Header append Cache-Control "public"

AddEncoding gzip .gz
RewriteCond %{HTTP:Accept-encoding} gzip
RewriteCond %{HTTP_USER_AGENT} !Safari
RewriteCond %{REQUEST_FILENAME}.gz -f
RewriteRule ^(.*)$ $1.gz [QSA,L]

#RewriteRule favicon.ico images/favicon.ico [NC,L]
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]
#php_flag magic_quotes_gpc Off

Any ideas of why this is happening?

Posts: 11
Joined: 02. May 2011 03:37

Re: Mod Rewrite Issue?

Postby Nobbie » 02. May 2011 10:39

vaciliy wrote:My first post, so please be patient.

Warum auf Englisch im Forum "Xampp auf Deutsch"?
Posts: 8629
Joined: 09. March 2008 13:04

Re: Mod Rewrite Issue?

Postby vaciliy » 02. May 2011 12:32

I didn't notice initially there is an English forum as well. I posted my question there.
Posts: 11
Joined: 02. May 2011 03:37

Return to XAMPP für Windows

Who is online

Users browsing this forum: No registered users and 8 guests