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.

Htaccess problem

Discussion in 'Apache' started by nitronet, Oct 16, 2012.

  1. #1
    My site provides user pages at domain.com/username

    My problem is I need a different page for domain.com/index or domain.com/aboutus etc.

    I really need a "dynamic" username rule with an exclude pages rule I guess.

    here is my htaccess code which gives a 500 error

    Options +FollowSymlinks
    RewriteEngine On

    DirectoryIndex index.html index.php

    ErrorDocument 404 /slap/pagenotfound
    ErrorDocument 403 /slap/pagenotfound
    ErrorDocument 401 /slap/pagenotfound
    ErrorDocument 500 /slap/pagenotfound

    #index
    RewriteRule index.html index.php

    #index
    RewriteRule ^home$ index.php
    ############ this script use to redirect site to the provided url #############
    #RewriteRule ^home$ http://slapgroups.com/index.php [L, R=301]

    #nopage
    RewriteRule ^pagenotfound$ nopage.php

    #Regitration
    RewriteRule ^register/createaccount$ userregistration.php

    #Regitration Confirmation
    RewriteRule ^register/accountconfirmation$ registrationconfirm.php

    #Activation Regitration
    RewriteRule ^accountactivation/([a-z,\_,A-Z,\_,\-,0-9]*)/([a-z,\_,A-Z,=,\_,\-,0-9]*)$ registrationactivation.php?UsercontactID=$1&AccountId=$2

    #after login
    RewriteRule ^user/main$ after_login.php

    #Payment Detail
    RewriteRule ^user/myaccount$ useraccount.php

    #Logout
    RewriteRule ^user/logout$ logoutuser.php

    #creategroup
    RewriteRule ^start/creategroup$ http://slapgroups.com/start/creategroup [R=301]
    #RewriteRule ^start/creategroup$ http://localhost/slap/start/creategroup [R=301]

    #Forgot Password
    RewriteRule ^user/forgotpassword$ http://slapgroups.com/user/forgotpassword [R=301]
    #RewriteRule ^user/forgotpassword$ http://localhost/slap/user/forgotpassword [R=301]

    #Login
    RewriteRule ^login/userlogin$ http://slapgroups.com/login/userlogin [R=301]
    #RewriteRule ^login/userlogin$ http://localhost/slap/login/userlogin [R=301]

    #Remove account
    RewriteRule ^account/remove$ removeuseraccount.php

    #Send an email page
    RewriteRule ^message/?$ contacttouser.php [QSA]

    #Report any site user page
    RewriteRule ^abuse/([0-9]*)/?$ reportsiteuser.php?reportUserID=$1 [QSA]

    #CMS FIND FRIENDS PAGE
    RewriteRule ^find/friend$ http://slapgroups.com/find/friend [R=301]

    #group Add Discuss page
    #RewriteRule ^([a-z,\_,A-Z,\_,\-,0-9.][^user/myaccount|home|pagenotfound|register/createaccount|accountactivation/([a-z,\_,A-Z,\_,\-,0-9]*)/([a-z,\_,A-Z,=,\_,\-,0-9]*)|user/main|user/myaccount|user/logout|start/creategroup|user/forgotpassword|login/userlogin|message/?|abuse/([0-9]*)|find/friend]*)/?$ memberspersonalinfo.php?members=$1 [QSA]

    RewriteRule ^([a-z,\_,A-Z,\_,\-,0-9.][^user/myaccount|home|pagenotfound|register/createaccount|user/main|user/myaccount|user/logout|start/creategroup|user/forgotpassword|login/userlogin|find/friend|(abuse/([0-9]*)/?)]*)/?$ memberspersonalinfo.php?members=$1 [QSA]

    #RewriteRule ^members/([a-z,\_,A-Z,\_,\-,0-9.]*)/?$ memberspersonalinfo.php?members=$1 [QSA]
     
    nitronet, Oct 16, 2012 IP
  2. wetbupa

    wetbupa Peon

    Messages:
    119
    Likes Received:
    2
    Best Answers:
    1
    Trophy Points:
    0
    #2

    All the rewrite rules seem to be correct , but some of them may be not supported because of the Apache configuration. You can rename the .htaccess file into .htaccess1 for example and in case 500 error won't appear, then some of the rules are incorrect.

    You can comment the .htacess file one after another and see which of Rewrite rules are causing the site error.
     
    wetbupa, Oct 17, 2012 IP