Jump to content

Using httpd.conf instead of htaccess ?


Recommended Posts

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

Link to comment
Share on other sites

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>

Link to comment
Share on other sites

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).

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Archived

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

  • Recently Browsing   0 members

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