The MU forums have moved to WordPress.org

Weird htacces behaviour PLS help :) (6 posts)

  1. zimen
    Member
    Posted 17 years ago #

    hello,

    i have an issue with the htaccess. Installed on a subdir of my website.

    the dir is: http://pigmotel.com/rooms/

    the htaccess works ONLY if I type the address EXACTLY as written above.

    IF I remove the trailing slash or I try to put a "www" and remove the trailing slash, it redirects to the main index of the website.

    could you help me and tell me what is wrong with it?

    Code:

    RewriteEngine On
    RewriteBase /rooms/
    # Rewrite http://www.domain.com to domain.com
    RewriteCond %{HTTP_HOST} ^www.(.*)
    RewriteRule ^(.*) http://%1/$1 [R,L]
    #uploaded files
    RewriteRule ^(.*)?/?files/(.*) wp-content/blogs.php?file=$2 [L]
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule . - [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-.*) $2 [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(.*.php)$ $2 [L]
    RewriteRule . index.php [L]

    Thank you very much.

    Simon

    p.s. when you try it w/out trail slash it will redirect you to the main public_html wich has another redirect to the "/it" dir. That is correct. Thank you.

  2. zimen
    Member
    Posted 17 years ago #

    Anyone can please help? I don't know how to resolve this. thank you

  3. pumpkinslayer
    Member
    Posted 17 years ago #

    For me...

    http://pigmotel.com/rooms went to http://pigmotel.com/rooms/
    http://www.pigmotel.com/rooms/ worked too

    but oh no...

    http://www.pigmotel.com/rooms directs me to a signup page for a new blog

    I'm no expert but I'd just mess with the lines that mention your domain name. Perhaps change /rooms/ to just /rooms

    Give it a try and post back.

  4. zimen
    Member
    Posted 17 years ago #

    "Perhaps change /rooms/ to just /rooms"

    Could you please tell me where I have to change this? Thanks

  5. andrea_r
    Moderator
    Posted 17 years ago #

    See the code you pasted up above? Second line.

  6. zimen
    Member
    Posted 17 years ago #

    Andrea, your solution did not work.

    I'm sure it's a misconfiguration with apache or virtual hosts.

    Thanks

    Simon

About this Topic