access httpd.conf and optimising htaccess

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
kkonline
Forum Contributor
Posts: 251
Joined: Thu Aug 16, 2007 12:54 am

access httpd.conf and optimising htaccess

Post by kkonline »

feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


How can i access the httpd.conf file on my shared hosting (or do i have to ask the hosting provider) I want to add some <location> based tags in it to prevent direct access as discussed earlier on the forum.

Secondly I am using the following as htaccess file. The redirection is getting bigger and bigger. Is that ok or is there any other solution to optimize the htaccess file

[syntax="apache"]Options +FollowSymLinks All
RewriteEngine On

# -FrontId-

IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*

<Limit GET POST>
order deny,allow
deny from all
allow from all
</Limit>
<Limit PUT DELETE>
order deny,allow
deny from all
</Limit>
AuthName mysite.com
AuthUserFile /home/mysite/public_html/_vti_pvt/service.pwd
AuthGroupFile /home/mysite/public_html/_vti_pvt/service.grp
RewriteCond %{HTTP_HOST} ^mysite.net$ [OR]
RewriteCond %{HTTP_HOST} ^www.mysite.net$
RewriteRule ^(.*)$ http://mysite.com [R=301,L]

RewriteCond %{HTTP_HOST} ^mysite.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.mysite.com$
RewriteRule ^/?$ http://mysite.com/bbeta [R=302,L]

RewriteRule ^/?(1)/(user)$ dir/index.php
RewriteRule ^/?(1)/(user)/$ dir/index.php

RewriteRule ^/?(1)/(user)/(submit)$ dir/submit.php
RewriteRule ^/?(1)/(user)/(submit)/$ dir/submit.php

RewriteRule ^/?(1)/([0-9]+)/([0-9]+)/([0-9]+)(/*)$ dir/ids.php?sectionid=$1&catid=$2&id=$3&val=$4&title=$5
RewriteRule ^/?(1)/([0-9]+)/([0-9]+)/([0-9]+)/(.*)$ dir/ids.php?sectionid=$1&catid=$2&id=$3&val=$4&title=$5

RewriteRule ^/?(1)/([0-9]+)/([0-9]+)/([a-zA-Z])$ dir/display.php?sectionid=$1&catid=$2&id=$3&alphabet=$4
RewriteRule ^/?(1)/([0-9]+)/([0-9]+)/([a-zA-Z])/$ dir/display.php?sectionid=$1&catid=$2&id=$3&alphabet=$4

RewriteRule ^/?(1)/([0-9]+)/([0-9]+)$ dir/display.php?sectionid=$1&catid=$2&id=$3
RewriteRule ^/?(1)/([0-9]+)/([0-9]+)/$ dir/display.php?sectionid=$1&catid=$2&id=$3

RewriteRule ^/?(1)/([0-9]+)/([0-9]+)/(change)$ dir/ew.php
RewriteRule ^/?(1)/([0-9]+)/([0-9]+)/(change)/$ dir/ew.php

RewriteRule ^/?([0-9]+)/([0-9]+)/([0-9]+)/(share)$ f/spreadit/spreadit.php
RewriteRule ^/?([0-9]+)/([0-9]+)/([0-9]+)/(share)/$ f/spreadit/spreadit.php

RewriteRule ^/?([0-9]+)/([0-9]+)/([0-9]+)/(post_post_comment)$ f/post_post_comment/post_post_comment.php
RewriteRule ^/?([0-9]+)/([0-9]+)/([0-9]+)/(post_post_comment)/$ f/post_post_comment/post_post_comment.php

RewriteRule ^/?([0-9]+)/([0-9]+)/([0-9]+)/(print)$ f/print/printid.php
RewriteRule ^/?([0-9]+)/([0-9]+)/([0-9]+)/(print)/$ f/print/printid.php

RewriteRule ^/?(1)/([0-9]+)/([0-9]+)/(pdf)$ f/fpdf/tutorial/pdfmodi.php?sectionid=$1&catid=$2&id=$3
RewriteRule ^/?(1)/([0-9]+)/([0-9]+)/(pdf)/$ f/fpdf/tutorial/pdfmodi.php?sectionid=$1&catid=$2&id=$3

RewriteRule ^/?(2)/(user)$ images/index.html
RewriteRule ^/?(2)/(user)/$ images/index.html

RewriteRule ^/?(2)/(user)/(submit)$ images/upload.php
RewriteRule ^/?(2)/(user)/(submit)/$ images/upload.php

RewriteRule ^/?(2)/([0-9]+)/([0-9]+)/([a-zA-Z])$ images/display.php?sectionid=$1&catid=$2&id=$3&alphabet=$4
RewriteRule ^/?(2)/([0-9]+)/([0-9]+)/([a-zA-Z])/$ images/display.php?sectionid=$1&catid=$2&id=$3&alphabet=$4

RewriteRule ^/?(2)/([0-9]+)/([0-9]+)$ images/display.php?sectionid=$1&catid=$2&id=$3
RewriteRule ^/?(2)/([0-9]+)/([0-9]+)/$ Imagess/display.php?sectionid=$1&catid=$2&id=$3

RewriteRule ^/?(2)/([0-9]+)/([0-9]+)/([0-9]+)(/*)$ iamges/ids.php?sectionid=$1&catid=$2&id=$3&val=$4&title=$5
RewriteRule ^/?(2)/([0-9]+)/([0-9]+)/([0-9]+)/(.*)$ images/ids.php?sectionid=$1&catid=$2&id=$3&val=$4&title=$5

feyd | Please use[/syntax]

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
nickvd
DevNet Resident
Posts: 1027
Joined: Thu Mar 10, 2005 5:27 pm
Location: Southern Ontario
Contact:

Post by nickvd »

No shared host on the planet will give you access to the httpd.conf ...

You may want to 'upgrade' to using a front-controller style system that will take care of the search engine friendly redirection for you... but I'm hardly the person to talk about that stuff ;)
Post Reply