httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Marek Sloboda" <sloma...@wp.pl>
Subject [users@httpd] htaccess looping
Date Wed, 13 Sep 2017 14:01:29 GMT
Hi, I've got problem with htaccess configuration. On my site i have 3 types of access

http://zeroproblem.pl -> direct to directory test2/index.php (which is file)
http://zeroproblem.pl/zeroproblem -> direct to directory test2/zeroproblem (which is directory)
http://zeroproblem.pl/admin -> is parameter and it should be like index.php?url=admin

my htaccess file:
php_flag  display_errors        on
Options -Indexes
Options -MultiViews
RewriteEngine On

#RewriteBase /test2/zeroproblem/
#usunięcie www.
RewriteCond %{HTTP_HOST} ^(www\.)zeroproblem\.pl$ [NC]
RewriteRule ^(.*)$ http://zeroproblem.pl/$1 [R=301,L]

# zeroproblem.pl/zeroproblem  - err 404 workaround for forbiden file

RewriteCond %{HTTP_HOST} ^(www\.)?zeroproblem\.pl$ [NC]
RewriteCond %{REQUEST_URI} ^/(.*)$ [NC]
RewriteCond %{REQUEST_FILENAME} -d [NC]
RewriteRule ^(.*)$ /index.php [QSA,L] 

# zeroproblem/admin
RewriteCond %{HTTP_HOST} ^(www\.)?zeroproblem\.pl$ 
RewriteCond %{REQUEST_URI} ^/(.*)$ 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-l 
RewriteRule ^(.*)$ /index.php?url=$1 [L,QSA] 

Above code is working, but problem is that when I'm starting new session on for ex. openinig
http://zeroproblem.pl/index.php the page is loading 3 times. After many tests I found that
problem is with 
RewriteCond %{REQUEST_FILENAME} !-f 
but I need that line for getitng to http://zeroproblem.pl/admin which is just parameter.
Please help me to understand problem.

P.S. My site is on sharing host, and I dont have access to conf.

Regards
Marek Słoboda 



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message