Announcement

Collapse
No announcement yet.

yourdomain.com/forums to www.yourdomain.com/forums

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • yourdomain.com/forums to www.yourdomain.com/forums

    Hi guys, I need help. i installed wordpress on my main domain which is www.yourdomain.com, and i have moved my forum to "/forums/". can someone give me the rewrite codes for directing non-www domain.com/forums to www.domain.com/forums?

    Example, when people type domain.com/forums it will direct them to www.domain.com/forums.

    My main root htaccess is using the below codes:

    Code:
     
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
     
    # END WordPress
    my public_html/forums htaccess is using the below codes:

    Code:
     
    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^yourdomain.com
    RewriteRule (.*) http://www.yourdomain.com/$1 [R=301,L]
    I also tried the below codes but it dont work at all.
    Code:
    RewriteCond %{HTTP_HOST} !^www\.yourdomain\.com
    RewriteRule (.*) http://www.yourdomain.com/$1 [L,R=301]
    All the above codes dont work at all. it will direct me to http://www.domain.com//home/psp/public_html/forums any ideas?

  • #2
    Try this:

    Code:
    Options +FollowSymlinks
    RewriteEngine on
    rewritecond %{http_host} ^domain.com [nc]
    rewriterule ^(.*)$ http://www.domain.com/$1 [r=301,nc]
    Vote for:

    - *Admin Settable Paid Subscription Reminder Timeframe*
    -
    *PM - Add ability to reply to originator only*
    - Add Admin ability to auto-subscribe users to specific channel(s)
    - "Quick Route" Interface...

    Comment


    • #3
      Originally posted by Trevor Hannant View Post
      Try this:

      Code:
      Options +FollowSymlinks
      RewriteEngine on
      rewritecond %{http_host} ^domain.com [nc]
      rewriterule ^(.*)$ http://www.domain.com/$1 [r=301,nc]
      it's not working at all. can someone please help me?

      Comment


      • #4
        can someone please help me?

        Comment


        • #5
          Originally posted by ahheng View Post
          can someone please help me?
          This is what I use in htaccess

          RewriteEngine On
          RewriteBase /

          RewriteCond %{HTTP_HOST} ^domain\.com
          RewriteRule ^(.*)$ http://www.domain.com/$1 [R=permanent,L,QSA]
          My law forum, lawyers and legal help site

          Comment


          • #6
            Originally posted by slinky View Post
            This is what I use in htaccess
            is not working. can anyone tell me the correct rewrite code that i should put in the public_html/forums?

            Comment


            • #7
              It doesn't go in forums. It goes in the root directory of your server.

              1. What kind of server do you have?
              2. Is it your own/dedicated or is it a shared server?
              3. Who is hosting it?
              My law forum, lawyers and legal help site

              Comment


              • #8
                Originally posted by slinky View Post
                It doesn't go in forums. It goes in the root directory of your server.

                1. What kind of server do you have?
                2. Is it your own/dedicated or is it a shared server?
                3. Who is hosting it?
                1. Linux
                2. Shared
                3. Vodien

                I did put the code on the main root but is not working too.

                Comment


                • #9
                  a. Your host might not have htaccess installed to do rewrites
                  b. Ask your host for support on this
                  My law forum, lawyers and legal help site

                  Comment


                  • #10
                    Have you tried logging into your cPanel and creating the redirect there?
                    CHIMPIE | SKYWARN | EMTLIFE

                    Comment


                    • #11
                      View your phpinfo from the admincp maintenance section, on the php page scroll down a bit and in the apache2handler section, in the loaded module box, see if it lists "mod_rewrite", if it dont, that is the reason for the rewrites not working.
                      Gentoo Geek

                      Comment


                      • #12
                        I am having the exact same issue with mod_rewrite. .htaccess is enabled, so is the module for mod_rewrite

                        Issue started when I upgraded to 4.0

                        Comment

                        widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
                        Working...
                        X