1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

500 Internal Server Error in .htaccess. Pls help

Discussion in 'Apache' started by iloveRP.com, Jun 18, 2010.

  1. #1
    Hi Friends,

    I want to redirect a domain.com to domain.com/folder, so I used this in rule .htaccess

    RewriteEngine On
    Options +FollowSymlinks
    RewriteCond %{HTTP_HOST} ^(www\.)?domainname\.com$ [NC]
    RewriteRule ^ http://www.domainname.com/folder[R,L]

    Unfortunately, when I reloaded the browser I got a 500 Internal Server Error.

    How can I fix this?
     
    iloveRP.com, Jun 18, 2010 IP
  2. bvsonline

    bvsonline Peon

    Messages:
    83
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Hi,

    try the code given below.
    ========
    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^(www.)?example.com$ [NC]
    RewriteCond %{REQUEST_URI} !^/subfolder/
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ /subfolder/$1
    RewriteCond %{HTTP_HOST} ^(www.)?example.com$ [NC]
    RewriteRule ^(/)?$ subfolder/index.html [L]
    ==============
     
    bvsonline, Jun 18, 2010 IP
  3. iloveRP.com

    iloveRP.com Peon

    Messages:
    457
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Hi Thanks, but the problem was solved using this command

    RewriteEngine On
    RewriteBase /
    RewriteCond %{HTTP_HOST} domain.com$
    RewriteRule ^(.*)$ subfolder [L]
     
    iloveRP.com, Jun 19, 2010 IP