Jump to content

htaccess file?


Go to solution Solved by Marc,

Recommended Posts

Posted

I have this htaccess file in my IPS forums directory and checking to see if this is the correct code? I am running 4.7.2.1 with PHP 8.0 - just trying to clean things up a bit since my board has been running for 20 years now and may have some "stray" stuff lingering!

Thanks

#Use PHP5 Single php.ini as default
#AddHandler application/x-httpd-php5s .php
#AddType application/x-httpd-php .html
<IfModule mod_rewrite.c>
Options -MultiViews
RewriteEngine On
RewriteCond %{SERVER_PORT} !^443$
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L]
RewriteBase /forums/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /forums/index.php [L]
</IfModule>

 

  • Solution
Posted

That isn't a standard one, no. You can get a standard htaccess from your admin CP by visiting System->Site Promotion->Search Engine Optimisation. You will see "Download this file" on that page

Posted
19 minutes ago, Marc Stridgen said:

That isn't a standard one, no. You can get a standard htaccess from your admin CP by visiting System->Site Promotion->Search Engine Optimisation. You will see "Download this file" on that page

I do not see that file to download?

Sorry my mistake - found!

Posted (edited)

@Daniel F Please some help - my htaccess is now like this

RewriteEngine on
RewriteCond %{HTTP_HOST} ^oldlibar\.website$ [OR]
RewriteCond %{HTTP_HOST} ^www\.oldlibar\.website$
RewriteRule ^ipb46\/?$ "https\:\/\/www\.oldlibar\.website\/" [R=301,L]

my what i download from my Admin cp is here

 

<IfModule mod_rewrite.c>
Options -MultiViews
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule \.(js|css|jpeg|jpg|gif|png|ico|map|webp)(\?|$) /404error.php [L,NC]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

How can make both in one or ...?

regards

Edited by bosss
Posted

You would add the bottom 3 lines of that top file, just below the "RewriteEngine on" part in the bottom if you wish to merge them. Note, we would not advise on any issues this may cause. We can assist only with the stock version, so this would be at your own risk.

Posted

@Marc Stridgen like here

 

<IfModule mod_rewrite.c>
Options -MultiViews
RewriteEngine On
RewriteCond %{HTTP_HOST} ^oldlibar\.website$ [OR]
RewriteCond %{HTTP_HOST} ^www\.oldlibar\.website$
RewriteRule ^ipb46\/?$ "https\:\/\/www\.oldlibar\.website\/" [R=301,L]
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule \.(js|css|jpeg|jpg|gif|png|ico|map|webp)(\?|$) /404error.php [L,NC]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

 

  • 2 months later...
Posted (edited)

Does the most recent htaccess file override the php version set on your server?   Our database is set to 8.0, but we have several htaccess files, the most recent showing php 7.1.   It's time for an upgrade that requires php 8.0 and I want to prevent any conflicts before the upgrade. 

 

# Use PHP71 as default
AddHandler application/x-httpd-php71 .php
<IfModule mod_suphp.c>
    suPHP_ConfigPath /opt/php71/lib
</IfModule>
Edited by savannahjan50
Posted
12 minutes ago, savannahjan50 said:

Does the most recent htaccess file override the php version set on your server?   Our database is set to 8.0, but we have several htaccess files, the most recent showing php 7.1.   It's time for an upgrade that requires php 8.0 and I want to prevent any conflicts before the upgrade. 

 

# Use PHP71 as default
AddHandler application/x-httpd-php71 .php
<IfModule mod_suphp.c>
    suPHP_ConfigPath /opt/php71/lib
</IfModule>

Please contact your hosting provider or server administrator for assistance with PHP issues. 

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...