Go Back   vb.org Archive > Community Discussions > Forum and Server Management
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 01-13-2011, 11:40 PM
final kaoss final kaoss is offline
 
Join Date: Apr 2006
Posts: 1,314
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default How is my htaccess?

I've noticed that images still take the longest to load according to firebug. Anyways here's my .htaccess

Code:
# Author: Matty Asia
# Version 1.6
# Downloaded from: http://www.vbulletin.com/forum/showthread.php?325798
RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} "Mozilla/4\.76 \[en\] \(Windows NT 5\.0; U\)"
RewriteRule .* - [F,L]
Options +FollowSymLinks
### THIS IS A LITTLE EXTRA SECURITY AND CAN BE REMOVED
#RewriteRule ^includes/(.*) index.php
#RewriteRule ^vb/(.*) index.php
#RewriteRule ^packages/(.*) index.php
### THIS IS THE ACTUAL REWRITE
RewriteRule ^threads/([0-9]+)(?:/?$|(?:-[^/]+))(?:/?$|(?:/page([0-9]+)?)) showthread.php?t=$1&page=$2&%{QUERY_STRING}
RewriteRule ^members/([0-9]+) member.php?u=$1&%{QUERY_STRING}
RewriteRule ^forums/([0-9]+)(?:/?$|(?:-[^/]+))(?:/?$|(?:/page([0-9]+)?)) forumdisplay.php?f=$1&page=$2&%{QUERY_STRING}
RewriteRule ^blogs/([0-9]+)(?:/?$|(?:-[^/]+))(?:/?$|(?:/page([0-9]+)?)) blog.php?u=$1&page=$2&%{QUERY_STRING}
RewriteRule ^entries/([0-9]+)(?:/?$|(?:-[^/]+))(?:/?$|(?:/page([0-9]+)?)) entry.php?b=$1&page=$2&%{QUERY_STRING}
RewriteRule ^list/([^/]*/)([0-9]+) list.php?r=$1$2&%{QUERY_STRING}
RewriteRule ^content/(.*) content.php?r=$1&%{QUERY_STRING}
RewriteRule ^widget/config/([0-9]+) widget.php?r=config/$1&%{QUERY_STRING}
RewriteRule ^((urllist|sitemap).*\.(xml|txt)(\.gz)?)$ vbseo_sitemap/vbseo_getsitemap.php?sitemap=$1 [L]
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^$ $1.php?r=$2 [QSA]
## Media Library 
## Charset
AddDefaultCharset Off 
## ETags
FileETag None
####Expires
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/gif A2592000
ExpiresByType image/jpeg A2592000
ExpiresByType image/png A2592000
ExpiresByType application/x-shockwave-flash A2592000
ExpiresByType text/css A2592000
ExpiresByType application/x-javascript A2592000
</IfModule>
####Gzip
<IfModule mod_rewrite.c>
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^(.*)(js|css)$ redir.php?file=$1$2&type=$2 [L]
</IfModule>
## Rewrites
RewriteEngine on
Options +FollowSymlinks
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
# Media Library
	ReWriteRule ^media/m(\d+).*/tags$ media.php?do=tags_edit&mid=$1 [QSA]
	ReWriteRule ^media/m(\d+).*/edit$ media.php?do=details_edit&mid=$1 [QSA]
	ReWriteRule ^media/m(\d+).*/report$ media.php?do=report&mid=$1 [QSA]
	ReWriteRule ^media/m(\d+).*/c(\d+)$ media.php?do=comment_edit&cmt=$2 [QSA]
	ReWriteRule ^media/m(\d+).*/p(\d+).*$ media.php?do=details&mid=$1&pid=$2 [QSA]
	ReWriteRule ^media/m(\d+).* media.php?do=details&mid=$1 [QSA]
	ReWriteRule ^media/p(\d+).*/edit$ media.php?do=playlist_edit&pid=$1 [QSA]
	ReWriteRule ^media/p(\d+).* media.php?do=playlist&pid=$1 [QSA]
	ReWriteRule ^media/c(\d+).* media.php?do=category&cid=$1 [QSA]
	ReWriteRule ^media/u(\d+).* media.php?do=user&uid=$1 [QSA]
	ReWriteRule ^media/tag/(.*) media.php?do=tag&tid=$1 [QSA]
	ReWriteRule ^media/results/(.*) media.php?do=results&query=$1 [QSA]
	ReWriteRule ^media/advresults/(.*) media.php?do=advresults&query=$1 [QSA]
	ReWriteRule ^media/letter/(.*) media.php?do=letter&query=$1 [QSA]
	ReWriteRule ^media/browse.* media.php?do=browse [QSA]
	ReWriteRule ^media/search.* media.php?do=search [QSA]
	ReWriteRule ^media/random.* media.php?do=random [QSA]
	ReWriteRule ^media/submit.* media.php?do=submit [QSA]
	ReWriteRule ^media/tagcloud.* media.php?do=tagcloud [QSA]
	ReWriteRule ^media/playlists.* media.php?do=playlists [QSA]
	ReWriteRule ^media/pcreate.* media.php?do=playlists_create [QSA]
	ReWriteRule ^media/pmine.* media.php?do=playlists_mine [QSA]
	ReWriteRule ^media/favorites.* media.php?do=favorites [QSA]
	ReWriteRule ^media/subscriptions.* media.php?do=subscriptions [QSA]
	ReWriteRule ^media/admin/edit/s(\d+).* media.php?do=admin_host_edit&sid=$1 [QSA]
	ReWriteRule ^media/admin/delete/s(\d+).* media.php?do=admin_host_delete&sid=$1 [QSA]
	ReWriteRule ^media/admin/export/s(\d+).* media.php?do=admin_host_export&sid=$1 [QSA]
	ReWriteRule ^media/admin/(\w+).* media.php?do=admin_$1 [QSA]
# Media Library from Video Directory
RewriteCond %{QUERY_STRING} do=viewdetails&videoid=(\d+)
RewriteRule ^video\.php$ media.php?do=details&mid=%1
RewriteCond %{QUERY_STRING} viewcategory&categoryid=(\d+)
RewriteRule ^video\.php$ media.php?do=category&cid=%1
RewriteCond %{QUERY_STRING} viewuser&userid=(\d+)
RewriteRule ^video\.php$ media.php?do=user&uid=%1
RewriteCond %{QUERY_STRING} viewtag&tag=(.*)
RewriteRule ^video\.php$ media.php?do=tag&tid=%1
ReWriteRule ^video\.php$ media.php
# Forum
RewriteRule ^threads/.* showthread.php [QSA]
RewriteRule ^forums/.* forumdisplay.php [QSA]
RewriteRule ^members/.* member.php [QSA]
RewriteRule ^blogs/.* blog.php [QSA]
ReWriteRule ^entries/.* entry.php [QSA]
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
# MVC
RewriteRule ^(?:(.*?)(?:/|$))(.*|$)$ $1.php?r=$2 [QSA]
ErrorDocument 404 /404.php
ErrorDocument 403 /404.php
ErrorDocument 500 /404.php
RewriteCond %{HTTP_HOST} ^vgc.x10hosting.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.vgc.10hosting.com$
RewriteRule ^/?$ "http\:\/\/vgchat\.info\/" [R=301,L]
# compress text, html, javascript, css, xml:
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
Reply With Quote
  #2  
Old 01-13-2011, 11:45 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

What is it exactly that you are trying to do with all of that?
Reply With Quote
  #3  
Old 01-13-2011, 11:48 PM
final kaoss final kaoss is offline
 
Join Date: Apr 2006
Posts: 1,314
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

rewrites & basic speed improvements. The media library bit takes up a bit of space lol.
Reply With Quote
  #4  
Old 01-13-2011, 11:54 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well, as you've noted, the images are slower to load, so maybe you need to prune some of that.
Reply With Quote
  #5  
Old 01-14-2011, 12:18 AM
final kaoss final kaoss is offline
 
Join Date: Apr 2006
Posts: 1,314
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No that's not why. I need to add a CDN next.
Reply With Quote
  #6  
Old 01-16-2011, 01:39 PM
eva2000's Avatar
eva2000 eva2000 is offline
 
Join Date: Oct 2001
Location: Brisbane, Australia
Posts: 577
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

no idea on .htaccess content itself, but for speed/resource utilisation better to move all that into httpd.conf virtualhost container for your domain rather than serve it via htaccess

some of the mod expire/deflate stuff can go into httpd.conf for global server wide usage across all domains instead too
Reply With Quote
  #7  
Old 01-31-2011, 04:40 PM
final kaoss final kaoss is offline
 
Join Date: Apr 2006
Posts: 1,314
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yeah on shared hosting from hostgator I don't see a httpd.conf file or virtualhost file/folder. Pretty much I was wondering if anyone could spot some "duplicate entries" or entries that do the same thing that can be removed and or suggest stuff to add to it/replace certain lines.
Reply With Quote
  #8  
Old 01-31-2011, 11:38 PM
KevinL KevinL is offline
 
Join Date: Apr 2005
Posts: 1,287
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That is huge lol You should ask your host to add that to the conf file.
Reply With Quote
  #9  
Old 02-10-2011, 11:58 PM
final kaoss final kaoss is offline
 
Join Date: Apr 2006
Posts: 1,314
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Kevin, that being in the htaccess has no impact on site load as far as I can tell. Also what benefit would it get from being in the conf file vs the htaccess? Also note that I have several htaccess files, for different sections of the site. I have some custom htaccess rules for a wordpress install, custom htaccess for the vbulletn, custom access for a mybb & custom htaccess for a mainly .html section, so putting all of that in the conf file is not an option as the custom rewrite rules will interfere with different sections of the site.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:30 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04707 seconds
  • Memory Usage 2,251KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (9)postbit
  • (9)postbit_onlinestatus
  • (9)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete