Welcome Guest, Not a member yet? Register   Sign In
mod_rewrite problems
#1

[eluser]Anonymous[/eluser]
I'm having some problems with a simple mod rewrite.

I'm trying to setup a 301 redirect on
domain.tld to www.domain.tld or with any other uri string
domain.tld/example-uri to www.domain.tld/example-uri

The problem:
Upon accessing www.domain.tld everyting goes well.
Upon accessing domain.tld i get redirected to www.domain.tld/domain/

I really have no clue where the last /domain/ comes from ?

My directory structure is as follows
Code:
-htdocs
  -www
     index.php
    .htaccess2
  -stats
  .htaccess1

For convenience i have numbered the .htaccess files 1 and 2.

.htacces1
Code:
<IfModule mod_rewrite.c>
   Options +FollowSymLinks
   Options +Indexes
   RewriteEngine On
   RewriteBase /
   RewriteCond %{HTTP_HOST} ^domain\.nl$
   RewriteRule ^(.*)$ http://www.domain.nl/$1 [R=301,L]
</IfModule>

.htaccess 2
Code:
RewriteEngine on
RewriteBase /
# Hide the application and system directories by redirecting the request to index.php
RewriteRule ^(application|system|\.svn) index.php/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [QSA,L]

Anyone care to help me ?
#2

[eluser]Anonymous[/eluser]
This is becoming real pain in the ass. Anybody can kick me in the right direction ?
#3

[eluser]pickupman[/eluser]
How About this for .htaccess2
Code:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^domain.nl [NC]
RewriteRule ^(.*)$ http://www.domain.nl/$1 [L,R=301]

RewriteRule ^(application|system|\.svn) index.php/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]

I don't think you would even need one above the document root. No one could browse up the tree to even access that file.




Theme © iAndrew 2016 - Forum software by © MyBB