Jump to content

Using httpd.conf instead of htaccess ?


Recommended Posts

Posted

Hi all, just wondering if anyone else has had any success using rewrite rules in httpd.conf file rather than having an htaccess file ... the main benefit from what I can see of doing this is to save on server resources but I've went into WHM, "Include Editor", "Pre VirtualHost Include" and pasted the contents of my htaccess file (minus the "RewriteBase /" line because that threw up errors) and now my URL's are showing "index.php" again (i.e. http://www.freewarebb.com/index.php/files/file/837-mozil ......) which leads me to believe those instructions aren't being read.

Any help appreciated

Thanks in advance

Marko

Posted

this has worked for me

<Directory /YOUR_DIRECTORY/public_html>
<IfModule mod_rewrite.c>
Options -MultiViews
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} .*.(jpeg|jpg|gif|png)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule . /public/404.php [L]

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

Posted

Hi all, just wondering if anyone else has had any success using rewrite rules in httpd.conf file rather than having an htaccess file ... the main benefit from what I can see of doing this is to save on server resources but I've went into WHM, "Include Editor", "Pre VirtualHost Include" and pasted the contents of my htaccess file (minus the "RewriteBase /" line because that threw up errors) and now my URL's are showing "index.php" again (i.e. http://www.freewarebb.com/index.php/files/file/837-mozil ......) which leads me to believe those instructions aren't being read.

Any help appreciated

Thanks in advance

Marko

I straight use .htaccess files with no major slowdowns that I notice, I think the performance/resource benefit is negligible. The major con is if you mess up something in the hosts file it can take multiple sites down instead of just one site(htaccess level).

Posted

Tried multiple methods, one/off, different paths, etc, nothing worked so just gave up in the end - I'd have tried further if I thought the speed and/or performance increase was significant enough to warrant it, but I doubt it would be :)

Posted

You wouldn't use cPanel if you cared at all about server resources...

Using httpd.conf will save you a bit but not much. If you're low on power, try swapping apache for nginx.

Posted

You wouldn't use cPanel if you cared at all about server resources...

Using httpd.conf will save you a bit but not much. If you're low on power, try swapping apache for nginx.

If you have plenty of resources, I don't see where it matters one way or another. I have a VPS with WHM and 3 cPanels ( 3 IPs flor 3 sites ) and no problems at all.

Posted

You wouldn't use cPanel if you cared at all about server resources...

Using httpd.conf will save you a bit but not much. If you're low on power, try swapping apache for nginx.

For WHM their are existing Nginx and Varnish Plugins to make installs take half the effort.

Also the nifty thing about whm is you can disable everything and anything, so if your not using email or spamd services disable them. If your not using the internal DNS server disable it. And youll save loads on memory and processing usage.

WHM isn't needed, but it makes like a hell of a lot easier.

Posted

these don't swap out apache as .time is proposing, they proxy to apache for cache purposes.

but apache is still used.

there is a litespeed module to replace apache for cpanel.

Posted

there is a litespeed module to replace apache for cpanel.


What does litespeed do that nginx doesn't, out of curiosity? I'd rather save my money.

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

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