Wordpress, .htaccess, and mod rewrite question

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tonyparra
    Confirmed User
    • Jul 2008
    • 4568

    #1

    Wordpress, .htaccess, and mod rewrite question

    Hello. I have some issues with the mod_rewrite. My situation is i have domain like so with wordpress being installed on the tld www.domain.com. I have .php pages though, that i cant import into wordpress, they are like so www.domain.com/1/page.php, www.domain.com/2/page.php, and so on. I would like to rewrite those .php extensions into .html or .htm. My problem is when i add this rules

    Options +FollowSymlinks
    RewriteEngine on
    RewriteRule ^(.*)\.htm$ $1.php [NC]

    it doesnt work and i cant log into my wordpress backend. I added that to the .htaccess file on the root level, and didnt touch any of the other wordpress stuff. Anyone know how to properly do this?

    High Performance Vps $10 Linode
    Manage your Digital Ocean, Linode, or Favorite Cloud Server. Simple, fast, and secure Server Pilot
  • AmeliaG
    Too lazy to set a custom title
    • Jan 2003
    • 10663

    #2
    I'd attempt to use the pages feature in WordPress if possible, maybe specific 301s if it is just a few pages I want to go elsewhere without losing SEO juice.
    GFY Hall of Famer

    AltStar Hall of Famer




    Blue Blood's SpookyCash.com

    Babe photography portfolio

    Comment

    • fatfoo
      ICQ:649699063
      • Mar 2003
      • 27763

      #3
      Try asking your host support to help you with your problems.
      Send me an email: [email protected]

      Comment

      • fris
        Too lazy to set a custom title
        • Aug 2002
        • 55679

        #4
        Originally posted by tonyparra
        Hello. I have some issues with the mod_rewrite. My situation is i have domain like so with wordpress being installed on the tld www.domain.com. I have .php pages though, that i cant import into wordpress, they are like so www.domain.com/1/page.php, www.domain.com/2/page.php, and so on. I would like to rewrite those .php extensions into .html or .htm. My problem is when i add this rules

        Options +FollowSymlinks
        RewriteEngine on
        RewriteRule ^(.*)\.htm$ $1.php [NC]

        it doesnt work and i cant log into my wordpress backend. I added that to the .htaccess file on the root level, and didnt touch any of the other wordpress stuff. Anyone know how to properly do this?
        this will check to make sure a .html file doesnt exist already

        http://www.domain.com/site.php will work as
        http://www.domain.com/site.html

        as well as dirs

        http://www.domain.com/directory/sammy.php will work as
        http://www.domain.com/directory/sammy.html

        Code:
        Options +FollowSymLinks
        RewriteEngine On
        RewriteCond %{SCRIPT_FILENAME} !-f
        RewriteCond %{REQUEST_URI} ^(/.+\.)html$ [NC]
        RewriteCond %{DOCUMENT_ROOT}%1php -f
        RewriteRule \.html$ %1php [NC,QSA,L]
        Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.

        Comment

        • tonyparra
          Confirmed User
          • Jul 2008
          • 4568

          #5
          Originally posted by fatfoo
          Try asking your host support to help you with your problems.
          bot alert

          High Performance Vps $10 Linode
          Manage your Digital Ocean, Linode, or Favorite Cloud Server. Simple, fast, and secure Server Pilot

          Comment

          • tonyparra
            Confirmed User
            • Jul 2008
            • 4568

            #6
            Originally posted by fris
            this will check to make sure a .html file doesnt exist already

            http://www.domain.com/site.php will work as
            http://www.domain.com/site.html

            as well as dirs

            http://www.domain.com/directory/sammy.php will work as
            http://www.domain.com/directory/sammy.html

            Code:
            Options +FollowSymLinks
            RewriteEngine On
            RewriteCond %{SCRIPT_FILENAME} !-f
            RewriteCond %{REQUEST_URI} ^(/.+\.)html$ [NC]
            RewriteCond %{DOCUMENT_ROOT}%1php -f
            RewriteRule \.html$ %1php [NC,QSA,L]
            you sir are a scholar and a gentleman will try now and report

            High Performance Vps $10 Linode
            Manage your Digital Ocean, Linode, or Favorite Cloud Server. Simple, fast, and secure Server Pilot

            Comment

            • tonyparra
              Confirmed User
              • Jul 2008
              • 4568

              #7
              thats it thanks thread closed.

              High Performance Vps $10 Linode
              Manage your Digital Ocean, Linode, or Favorite Cloud Server. Simple, fast, and secure Server Pilot

              Comment

              • LoveSandra
                So Fucking Banned
                • Aug 2008
                • 10551

                #8
                Originally posted by fatfoo
                Try asking your host support to help you with your problems.

                Comment

                • fris
                  Too lazy to set a custom title
                  • Aug 2002
                  • 55679

                  #9
                  Originally posted by tonyparra
                  thats it thanks thread closed.
                  no problem.
                  Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.

                  Comment

                  Working...