.htaccess file editing

6 replies
I want to update my hosting to php 5.3, i need to add this line to my .htaccess file - "# Use PHP 5.3
AddType application/x-httpd-php53 .php " (without "")

Now i have in my file this code already: "# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress"


Is it good to put my php 5.3 code like this: "# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# Use PHP 5.3
AddType application/x-httpd-php53 .php

# END WordPress"

or i should add it above that code or bellow that code? Any ideas?
#editing #file #htaccess
  • Profile picture of the author Kingfish85
    If the core install of PHP is 5.3, you do not need to specify the version. Who is managing the server? Is it yours or are you using shared hosting?

    If 5.3 is not running, adding those lines means nothing..
    Signature

    |~| VeeroTech Hosting - sales @ veerotech.net
    |~| High Performance CloudLinux & LiteSpeed Powered Web Hosting
    |~| cPanel & WHM - Softaculous - Website Builder - R1Soft - SpamExperts
    |~| Visit us @veerotech Facebook - Twitter - LinkedIn

    {{ DiscussionBoard.errors[8195572].message }}
    • Profile picture of the author ChevyCam
      Originally Posted by Kingfish85 View Post

      If the core install of PHP is 5.3, you do not need to specify the version. Who is managing the server? Is it yours or are you using shared hosting?

      If 5.3 is not running, adding those lines means nothing..

      I am using hostgator shared hosting plan. By their instructions if you want to use 5.3 you have to add this line to .htaccess file. One plugin wasn't working because till i added that line, because it required php 5.3. I added that code like this:

      Code:
      # BEGIN WordPress
      <IfModule mod_rewrite.c>
      RewriteEngine On
      RewriteBase /
      RewriteRule ^index.php$ - [L]
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteRule . /index.php [L]
      </IfModule>
       
      # Use PHP 5.3
      AddType application/x-httpd-php53 .php 
       
      # END WordPress
      Plugin seems to be working, but still is it good to add that value like i added? or it would be better to add it outside?
      # BEGIN WordPress
      # END WordPress

      Does it even make any differences?
      {{ DiscussionBoard.errors[8195582].message }}
      • Profile picture of the author Kingfish85
        Originally Posted by ChevyCam View Post

        I am using hostgator shared hosting plan. By their instructions if you want to use 5.3 you have to add this line to .htaccess file. One plugin wasn't working because till i added that line, because it required php 5.3. I added that code like this:

        Code:
        # BEGIN WordPress
        <IfModule mod_rewrite.c>
        RewriteEngine On
        RewriteBase /
        RewriteRule ^index.php$ - [L]
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteRule . /index.php [L]
        </IfModule>
         
        # Use PHP 5.3
        AddType application/x-httpd-php53 .php 
         
        # END WordPress
        Plugin seems to be working, but still is it good to add that value like i added? or it would be better to add it outside?
        # BEGIN WordPress
        # END WordPress

        Does it even make any differences?
        What version are they using?

        Forcing the site to use an older version isn't the best way to go about this. The best way to go about this would be find another plugin because the developer can't keep their software updated with the latest versions & relies on deprecated functions most likely.

        What plugin is it that's causing a problem? Most likely, you'll end up breaking other things if you force an older version.

        EDIT: To directly answer your question, yes, it should work.
        Signature

        |~| VeeroTech Hosting - sales @ veerotech.net
        |~| High Performance CloudLinux & LiteSpeed Powered Web Hosting
        |~| cPanel & WHM - Softaculous - Website Builder - R1Soft - SpamExperts
        |~| Visit us @veerotech Facebook - Twitter - LinkedIn

        {{ DiscussionBoard.errors[8195593].message }}
        • Profile picture of the author ChevyCam
          Originally Posted by Kingfish85 View Post

          What version are they using? If the plugin is specifying 5.3, and is not working because of that, I sure hope HS is using 5.4.

          Forcing the site to use an older version isn't the best way to go about this. The best way to go about this would be find another plugin because the developer can't keep their software updated with the latest versions & relies on deprecated functions most likely.

          What plugin is it that's causing a problem? Most likely, you'll end up breaking other things if you force an older version.

          EDIT: To directly answer your question, yes, it should work.
          The plugin is Yoast Seo plugin for wordpress, after new update everyone got error. Fix was to add that line (for Hostgator users).

          You can see about hostgator and what php they are using in here - PHP 5.3 « HostGator.com Support Portal

          They don't use 5.4 as i can see. By default they still use 5.2 for shared plans.
          {{ DiscussionBoard.errors[8195613].message }}
          • Profile picture of the author Kingfish85
            Originally Posted by ChevyCam View Post

            The plugin is Yoast Seo plugin for wordpress, after new update everyone got error. Fix was to add that line (for Hostgator users).

            You can see about hostgator and what php they are using in here - PHP 5.3 « HostGator.com Support Portal

            They don't use 5.4 as i can see. By default they still use 5.2 for shared plans.
            Yea, you'd want to add that line at the top then to force the version & keep it outside of the Wordpress lines.

            EDIT: And what I meant above was that most developers should be keeping their software up to date.
            Signature

            |~| VeeroTech Hosting - sales @ veerotech.net
            |~| High Performance CloudLinux & LiteSpeed Powered Web Hosting
            |~| cPanel & WHM - Softaculous - Website Builder - R1Soft - SpamExperts
            |~| Visit us @veerotech Facebook - Twitter - LinkedIn

            {{ DiscussionBoard.errors[8195628].message }}
  • Profile picture of the author 1stranked
    It is ok to use that code below or above WordPress code. Apache server is configured to use those options so you can pass parameters to it.
    {{ DiscussionBoard.errors[8196557].message }}

Trending Topics