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.

Error when .htaccess file uploaded..why?

Discussion in 'Apache' started by netpox, Oct 1, 2007.

  1. #1
    When i run the website without my .htaccess file uploaded it works but as soon as i upload my .htaccess file i get this error when i try to view my site in the browser:

    Internal Server Error
    The server encountered an internal error or misconfiguration and was unable to complete your request.
    Please contact the server administrator, and inform them of the time the error occurred, and anything you might have done that may have caused the error.

    More information about this error may be available in the server error log.


    Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.


    Also when i ftp my .htaccess file i can never see it in my ftp client..it uploads but then its not showing up anywhere in my /html_public/ folder.
     
    netpox, Oct 1, 2007 IP
  2. jmhyer123

    jmhyer123 Peon

    Messages:
    542
    Likes Received:
    25
    Best Answers:
    0
    Trophy Points:
    0
    #2
    depending on what FTP client you are using make sure it is set to show .htaccess files (shouldn't be the problem but some clients won't show them :() also make sure it is uploading ASCII mode rather than Binary mode (or maybe the other way around, better try both :D) that is the most common problem people have is the mode it is uploading in.
     
    jmhyer123, Oct 1, 2007 IP
  3. hans

    hans Well-Known Member

    Messages:
    2,923
    Likes Received:
    126
    Best Answers:
    1
    Trophy Points:
    173
    #3
    a server 500 error means a fatal error in your .htaccess syntax
    look line by line at your syntax used in your .htaccess

    after uploading your .htaccess - of course you verify permissions
    .htaccess would be 644 and have same ownership as your regular HTML files

    if in doubt - remove questionable lines and try again

    if unsure about .htaccess syntax, then read apache howtos
    http://httpd.apache.org/docs/
    be sure to select the correct apache VERSION !! for your syntax

    the syntax used in .htaccess is exactly as it would be in apache default configuration file

    if you need more help, then publish the full .htaccess HERE in the forum
     
    hans, Oct 1, 2007 IP
  4. netpox

    netpox Active Member

    Messages:
    1,625
    Likes Received:
    27
    Best Answers:
    0
    Trophy Points:
    90
    #4
    It's weird because the same script and .htaccess file works on a different server but on the new one i'm trying to set it up on does not.
    Here is what's in my .htaccess file:

    SecFilterEngine Off
    SecFilterScanPOST Off

    AddHandler application/x-httpd-php5 .php

    RewriteEngine on

    RewriteRule ^login/$ login.php


    RewriteRule ^logout/$ logout.php

    RewriteRule ^index/$ index.php

    RewriteRule ^devlogin/$ devLogin.php

    RewriteRule ^signup/$ signup.php

    RewriteRule ^forgotpassword/$ forgotPassword.php

    RewriteRule ^verifymail/$ verifyMail.php


    RewriteRule ^verifypasswordmail/$ verifyPasswordMail.php

    #---------photo-------

    RewriteRule ^photolist/([^\/]+)/$ photoList.php?pg=$1&%{QUERY_STRING}

    RewriteRule ^viewphoto/([^\/]+)/$ viewPhoto.php?photo_id=$1&%{QUERY_STRING}

    RewriteRule ^viewphoto/([^\/]+)/([^\/]+)/$ viewPhoto.php?photo_id=$1&%{QUERY_STRING}

    RewriteRule ^photopreview/([^\/]+)/$ photoPreview.php?photo_id=$1&%{QUERY_STRING}

    RewriteRule ^photopreview/([^\/]+)/([^\/]+)/$ photoPreview.php?photo_id=$1&%{QUERY_STRING}

    RewriteRule ^sharephoto/([^\/]+)/$ sharePhoto.php?photo_id=$1&%{QUERY_STRING}

    RewriteRule ^photoupload/$ members/photoUpload.php

    RewriteRule ^photoupload/([^\/]+)/$ members/photoUpload.php?photo_id=$1&%{QUERY_STRING}

    RewriteRule ^photocreatealbum/$ members/photoCreateAlbum.php

    RewriteRule ^myphotoalbums/$ members/myPhotoAlbums.php

    RewriteRule ^managephotocomments/$ members/managePhotoComments.php

    RewriteRule ^photocategory/$ photoCategory.php

    RewriteRule ^rssphoto/$ rssPhoto.php

    #--------video---------

    RewriteRule ^videolist/([^\/]+)/$ videoList.php?pg=$1&%{QUERY_STRING}

    RewriteRule ^viewvideo/([^\/]+)/$ viewVideo.php?video_id=$1&%{QUERY_STRING}

    RewriteRule ^viewvideo/([^\/]+)/([^\/]+)/$ viewVideo.php?video_id=$1&%{QUERY_STRING}

    RewriteRule ^viewvideofull/([^\/]+)/$ viewVideoFull.php?video_id=$1&%{QUERY_STRING}

    RewriteRule ^viewvideofull/([^\/]+)/([^\/]+)/$ viewVideoFull.php?group_id=$1&video_id=$2&%{QUERY_STRING}

    RewriteRule ^videoconfigxmlcode/$ videoConfigXmlCode.php

    RewriteRule ^videoplaylistxmlcode/$ videoPlaylistXmlCode.php

    RewriteRule ^videoupload/$ members/videoUpload.php

    RewriteRule ^videocategory/$ videoCategory.php

    RewriteRule ^videouploadpopup/$ members/videoUploadPopUp.php

    RewriteRule ^videouploadpopup/([^\/]+)/$ members/videoUploadPopUp.php?video_id=$1&%{QUERY_STRING}

    RewriteRule ^videocreatealbum/$ members/videoCreateAlbum.php

    RewriteRule ^myvideoalbums/$ members/myVideoAlbums.php

    RewriteRule ^managevideocomments/$ members/manageVideoComments.php

    RewriteRule ^sharevideo/([^\/]+)/$ shareVideo.php?video_id=$1&%{QUERY_STRING}

    RewriteRule ^tags/([^\/]+)/$ tags.php?pg=$1&%{QUERY_STRING}

    RewriteRule ^rssvideo/$ rss.php

    #--------music---------

    RewriteRule ^musiclist/([^\/]+)/$ musicList.php?pg=$1&%{QUERY_STRING}

    RewriteRule ^music/([^\/]+)/$ music.php?music_id=$1&%{QUERY_STRING}

    RewriteRule ^music/([^\/]+)/([^\/]+)/$ music.php?music_id=$1&%{QUERY_STRING}

    RewriteRule ^musicconfigxmlcode/$ musicConfigXmlCode.php

    RewriteRule ^musicplaylistxmlcode/$ musicPlaylistXmlCode.php

    RewriteRule ^musicupload/$ members/musicUpload.php

    RewriteRule ^musiccategory/$ musicCategory.php

    RewriteRule ^musicuploadpopup/$ members/musicUploadPopUp.php

    RewriteRule ^musicuploadpopup/([^\/]+)/$ members/musicUploadPopUp.php?music_id=$1&%{QUERY_STRING}

    RewriteRule ^musiccreatealbum/$ members/musicCreateAlbum.php

    RewriteRule ^mymusicalbums/$ members/myMusicAlbums.php

    RewriteRule ^managemusiccomments/$ members/manageMusicComments.php

    RewriteRule ^sharemusic/([^\/]+)/$ shareMusic.php?music_id=$1&%{QUERY_STRING}

    RewriteRule ^tags/([^\/]+)/$ tags.php?pg=$1&%{QUERY_STRING}

    RewriteRule ^rssmusic/$ rssMusic.php

    #-------Community---------

    RewriteRule ^community/$ communityList.php

    #-------Groups---------

    RewriteRule ^group/$ groupListAll.php

    RewriteRule ^group/([^\/]+)/$ groupHome.php?group_id=$1&%{QUERY_STRING}

    RewriteRule ^groupcategory/$ groupCategory.php

    RewriteRule ^groupmembers/([^\/]+)/$ groupMembersList.php?group_id=$1&%{QUERY_STRING}

    RewriteRule ^groupjoin/([^\/]+)/$ groupJoin.php?group_id=$1&%{QUERY_STRING}

    RewriteRule ^myGroup/$ members/groupMy.php

    RewriteRule ^groupcreate/$ members/groupCreate.php

    RewriteRule ^groupcreate/([^\/]+)/$ members/groupCreate.php?group_id=$1

    RewriteRule ^groupinvite/([^\/]+)/$ members/groupInvite.php?group_id=$1&%{QUERY_STRING}

    RewriteRule ^groupacceptmember/$ members/groupAcceptMember.php

    RewriteRule ^groupjoinmember/$ members/groupJoinMember.php

    RewriteRule ^groupdelete/([^\/]+)/$ members/groupDelete.php?group_id=$1

    RewriteRule ^groupforums/([^\/]+)/$ groupListAllForum.php?group_id=$1

    RewriteRule ^groupforums/([^\/]+)/([^\/]+)/$ groupListAllTopic.php?group_id=$1&group_forum_id=$2

    RewriteRule ^groupforums/([^\/]+)/([^\/]+)/([^\/]+)/$ groupListAllResponse.php?group_id=$1&group_forum_id=$2&group_forum_topic_id=$3

    RewriteRule ^groupcreateforum/([^\/]+)/$ members/groupCreateForum.php?group_id=$1&%{QUERY_STRING}

    RewriteRule ^groupcreateforum/([^\/]+)/([^\/]+)/$ members/groupCreateTopic.php?group_id=$1&group_forum_id=$2&%{QUERY_STRING}

    RewriteRule ^groupcreateforum/([^\/]+)/([^\/]+)/([^\/]+)/$ members/groupCreateResponse.php?group_id=$1&group_forum_id=$2&group_forum_topic_id=$3&%{QUERY_STRING}

    RewriteRule ^groupcreateforum/([^\/]+)/([^\/]+)/([^\/]+)/([^\/]+)/$ members/groupCreateResponse.php?group_id=$1&group_forum_id=$2&group_forum_topic_id=$3&group_forum_response_id=$4&%{QUERY_STRING}

    RewriteRule ^groupvideos/([^\/]+)/$ groupVideoList.php?group_id=$1&%{QUERY_STRING}

    RewriteRule ^groupvideoupload/([^\/]+)/$ members/groupVideoUpload.php?group_id=$1&%{QUERY_STRING}

    RewriteRule ^groupvideouploadpopup/([^\/]+)/$ members/groupVideoUploadPopUp.php?group_id=$1&%{QUERY_STRING}

    RewriteRule ^groupviewvideo/([^\/]+)/([^\/]+)/([^\/]+)/$ groupViewVideo.php?group_id=$1&video_id=$2&%{QUERY_STRING}

    RewriteRule ^groupviewvideo/([^\/]+)/([^\/]+)/$ groupViewVideo.php?group_id=$1&video_id=$2&%{QUERY_STRING}

    RewriteRule ^groupphotos/([^\/]+)/$ groupPhotoList.php?group_id=$1&%{QUERY_STRING}

    RewriteRule ^groupphotoupload/([^\/]+)/$ members/groupPhotoUpload.php?group_id=$1&%{QUERY_STRING}

    RewriteRule ^groupviewphoto/([^\/]+)/([^\/]+)/([^\/]+)/$ groupViewPhoto.php?group_id=$1&photo_id=$2&%{QUERY_STRING}

    RewriteRule ^groupviewphoto/([^\/]+)/([^\/]+)/$ groupViewPhoto.php?group_id=$1&photo_id=$2&%{QUERY_STRING}

    RewriteRule ^groupphotopreview/([^\/]+)/([^\/]+)/([^\/]+)/$ groupPhotoPreview.php?group_id=$1&photo_id=$2&%{QUERY_STRING}

    RewriteRule ^groupphotopreview/([^\/]+)/([^\/]+)/$ groupPhotoPreview.php?group_id=$1&photo_id=$2&%{QUERY_STRING}

    #-------Bulletins---------

    RewriteRule ^bulletin/$ bulletinListAll.php

    RewriteRule ^mybulletin/$ members/bulletinMy.php

    RewriteRule ^bulletin/([^\/]+)/$ bulletinView.php?bulletin_id=$1&%{QUERY_STRING}

    RewriteRule ^bulletincreate/$ members/bulletinCreate.php

    #-------Forums---------

    RewriteRule ^forums/$ forumsListAll.php

    RewriteRule ^forums/([^\/]+)/$ forumsTopicListAll.php?forum_id=$1&%{QUERY_STRING}

    RewriteRule ^forums/([^\/]+)/([^\/]+)/$ forumsResponseListAll.php?forum_id=$1&topic_id=$2&%{QUERY_STRING}

    RewriteRule ^forumcreate/([^\/]+)/$ members/forumsTopicCreate.php?forum_id=$1&%{QUERY_STRING}

    RewriteRule ^forumcreate/([^\/]+)/([^\/]+)/$ members/forumsResponseCreate.php?forum_id=$1&topic_id=$2&%{QUERY_STRING}

    RewriteRule ^forumcreate/([^\/]+)/([^\/]+)/([^\/]+)/$ members/forumsResponseCreate.php?forum_id=$1&topic_id=$2&response_id=$3&%{QUERY_STRING}

    #-------Shoutouts---------

    RewriteRule ^shoutouts/$ shoutouts.php

    #-------Mail---------

    RewriteRule ^mail/compose/$ members/mailCompose.php

    RewriteRule ^mail/inbox/$ members/mail.php?folder=inbox&%{QUERY_STRING}

    RewriteRule ^mail/sent/$ members/mail.php?folder=sent&%{QUERY_STRING}

    RewriteRule ^mail/saved/$ members/mail.php?folder=saved&%{QUERY_STRING}

    RewriteRule ^mail/trash/$ members/mail.php?folder=trash&%{QUERY_STRING}

    RewriteRule ^mail/request/$ members/mail.php?folder=request&%{QUERY_STRING}

    RewriteRule ^mail/video/$ members/mail.php?folder=video&%{QUERY_STRING}

    RewriteRule ^readmail/inbox/$ members/mailRead.php?folder=inbox&%{QUERY_STRING}

    RewriteRule ^readmail/sent/$ members/mailRead.php?folder=sent&%{QUERY_STRING}

    RewriteRule ^readmail/saved/$ members/mailRead.php?folder=saved&%{QUERY_STRING}

    RewriteRule ^readmail/trash/$ members/mailRead.php?folder=trash&%{QUERY_STRING}

    RewriteRule ^readmail/request/$ members/mailRead.php?folder=request&%{QUERY_STRING}

    RewriteRule ^readmail/video/$ members/mailRead.php?folder=video&%{QUERY_STRING}

    RewriteRule ^selectuser/$ members/selectUsernames.php

    #-------Others---------

    RewriteRule ^contactus/$ contactUs.php

    RewriteRule ^bulletins/test/$ bulletins/test.php

    RewriteRule ^bulletins/abc/$ bulletins/abc.php

    RewriteRule ^search/$ search.php?%{QUERY_STRING}

    RewriteRule ^viewprofile/([^\/]+)/$ viewProfile.php?user=$1&%{QUERY_STRING}

    RewriteRule ^myhome/$ members/myHome.php

    RewriteRule groupjoinmember/$ groupJoinMember.php

    RewriteRule friendaccept/$ friendAccept.php

    RewriteRule ^news/$ news.php

    RewriteRule ^faq/$ faq.php

    RewriteRule ^static/([^\/]+)/$ staticPage.php?pg=$1&%{QUERY_STRING}

    RewriteRule ^banner/$ members/manageBanner.php

    RewriteRule ^earnings/$ members/earnings.php

    #-------Members---------

    RewriteRule ^memberslist/$ membersList.php?%{QUERY_STRING}

    RewriteRule ^memberssearch/$ members/membersAdvSearch.php?%{QUERY_STRING}

    RewriteRule ^membersbrowse/$ members/membersBrowse.php?%{QUERY_STRING}

    RewriteRule ^profile/basic/$ members/profileBasic.php?%{QUERY_STRING}

    RewriteRule ^profile/personal/$ members/profilePersonal.php?%{QUERY_STRING}

    RewriteRule ^profile/settings/$ members/profileSettings.php?%{QUERY_STRING}

    RewriteRule ^profile/password/$ members/profilePassword.php?%{QUERY_STRING}

    RewriteRule ^profile/other/$ members/profileOtherInfo.php?%{QUERY_STRING}

    RewriteRule ^profile/customize/$ members/profileThemeDesign.php?%{QUERY_STRING}

    RewriteRule ^profile/theme/$ members/profileTheme.php?%{QUERY_STRING}

    RewriteRule ^profile/block/$ memberBlock.php?%{QUERY_STRING}

    RewriteRule ^profile/add/group/$ members/addToGroup.php?%{QUERY_STRING}

    RewriteRule ^profile/friend/add/$ members/friendAdd.php?%{QUERY_STRING}

    RewriteRule ^profile/friend/accept/$ members/friendAccept.php?%{QUERY_STRING}

    RewriteRule ^profile/relation/manage/$ members/relationManage.php?%{QUERY_STRING}

    RewriteRule ^profile/relation/view/$ members/relationView.php?%{QUERY_STRING}

    RewriteRule ^myfriends/$ members/myFriends.php?%{QUERY_STRING}

    RewriteRule ^myprofile/$ members/myProfile.php?%{QUERY_STRING}

    RewriteRule ^viewfriends/([^\/]+)/$ viewFriends.php?user=$1&%{QUERY_STRING}

    RewriteRule ^profilecomments/$ profileComments.php?%{QUERY_STRING}

    RewriteRule ^invitation/send/$ members/membersInvite.php?%{QUERY_STRING}

    RewriteRule ^invitation/sent/$ members/invitationHistory.php?%{QUERY_STRING}

    #-------Blogs---------

    RewriteRule ^manageblog/$ manageBlog.php?%{QUERY_STRING}
    RewriteRule ^bloglist/$ blogList.php?%{QUERY_STRING}
    RewriteRule ^blogcomment/$ blogComment.php?%{QUERY_STRING}
    RewriteRule ^blogcategory/$ blogCategory.php?%{QUERY_STRING}

    #------Js-----

    RewriteRule ^js/home/$ members/jsMyHome.php
     
    netpox, Oct 1, 2007 IP
  5. Camay123

    Camay123 Well-Known Member

    Messages:
    3,423
    Likes Received:
    86
    Best Answers:
    0
    Trophy Points:
    160
    #5
    It's pretty hard to tell. Something must be diferent on this server then the other one you are talking about. Are you sure it as PHP5 ?
     
    Camay123, Oct 1, 2007 IP
  6. hans

    hans Well-Known Member

    Messages:
    2,923
    Likes Received:
    126
    Best Answers:
    1
    Trophy Points:
    173
    #6
    let's analyize:

    1.
    check what apache version you have on new server and on OTHER server where the .htaccess works

    2.
    assuming that all your rewrite stuff works

    remove it all

    reduce your .htaccess to NON-rewrite stuff

    and see what causes your 500

    with my limited knowledge in apache problem solving I see only 3 lines that can cause your fatal server error:

    SecFilterEngine Off
    SecFilterScanPOST Off

    AddHandler application/x-httpd-php5 .php

    most likely only the first 2 lines

    if your server admin has override disabled for any of the 2 options
    SecFilterEngine Off
    SecFilterScanPOST Off

    then that may cause your 500 server error

    you may then also try to embed your above lines - separately ) into the full syntax like

    <IfModule mod_security.c>
    SecFilterEngine Off
    </IfModule>

    same for the other line - just find the correct IfModule-name for it)

    the error may be caused if an option you switch ON or OFF is inexistant.

    to find out what apache modules you have installed
    upload the following line - embedded in a regular HTML file with header and body tags - of PHP code onto your server

    <? phpinfo(); ?>

    load the page in your browser and see all the apache modules installed.

    ------

    if however you have a different apache version on OTHER site - then you may have to look at the entire .htaccess syntax to assure it works on the new server. I was moving a year ago from apache 1.3 to 2.2 and had do make significant changes in my mod_rewrite server config before it worked again.
     
    hans, Oct 1, 2007 IP
  7. netpox

    netpox Active Member

    Messages:
    1,625
    Likes Received:
    27
    Best Answers:
    0
    Trophy Points:
    90
    #7
    I took off the first 3 lines and it works now. What does each of these lines mean?

    SecFilterEngine Off
    SecFilterScanPOST Off

    AddHandler application/x-httpd-php5 .php

    Do i need them?
     
    netpox, Oct 1, 2007 IP
  8. hans

    hans Well-Known Member

    Messages:
    2,923
    Likes Received:
    126
    Best Answers:
    1
    Trophy Points:
    173
    #8
    YOU are joking now
    since you added these lines into your .htaccess
    that should mean you have detected a need to add such custom apache configuration in addition to the default configuration setup by your host-admin.

    normally every host has a complete and fully working and fully security conscious server setup - hence normally there should be no need to add anything at all

    except

    mod rewrite stuff for your URLs as needed by certain SW and deny from .. lines to exclude particular hackers etc


    AddHandler application/x-httpd-php5 .php

    normally always is done in the server default config

    remove this line - surf your PHP pages
    if they display correctly then that line is already in the server config

    for the meaning of

    SecFilterEngine Off
    SecFilterScanPOST Off

    have a look at
    1. apache doc at the apache URL given above
    I am NOT familiar with those options - in 10+ years never needed to switch them OFF.

    2. only derivate from default server config if you NEED to do so to get an installed SW script running at all OR if it increases your own server security.

    look at the manuals of any installed scripts if they REQUIRE you to use

    SecFilterEngine Off
    SecFilterScanPOST Off

    else remove the lines and be happy.
     
    hans, Oct 1, 2007 IP