Find programmers and grapic design experts at ScriptLance.com
<? DEW-CODE.COM  

Downloads

Assorted scripts  (1)
DewNewPHPLinks  (7)





Lost Password?
No account yet? Register

Dew-Code Newsfeed

More Dew-Code Stuff

Tech & Net Video
Many people seem to the think Dew-Code.com is run by a group of people, or some big corporation. Well, it's flattering if you have that impression, but the truth is, its just one person. While I'd love nothing more than to continue giving away my scripts, my time and experience, I do have the same needs as everyone else. If you've found Dew-Code.com , or any of the scripts found there to be helpful, please consider making a contribution.

For the year 2008, as of 10/1/06, A total of $155 USD has been contributed, or roughly $15.50 per month, for the year. While that is of course appreciated, unless more contributions are received, I will have no choice but to make future scripts available for purchase only.

Regards,
Dewed
Dew-Code.com

Getting DNPL to act as default homepage E-mail

Installing DewNewPHPLinks in your web server's document root to create an enire site.

 

Many people are using DewNewPHPLinks to create their entire site. While that is a bit flattering, it wasn't really designed for this. A fresh install in your web server's document root will cause the included index.php to be invoked which in turn does a 301 redirect to the actual script, which is named simply "directory". That's fine for your typical visitor, but not so fine for search engine spiders.

 

Adding a mod-rewrite rule to the included .htaccess file will make it appear as if you have an index.html file, so the directory script will be served as your homepage (eg; when no filename is requested.) 

 

I've extended that concept, so that even if a viewer requests index.php, htm or html they still get the actual script.

 

I've also included a rule to enforce  the use of www when requesting your domain. This helps to ensure everyone that might link to your site uses a consistent domain name.

 

Of course for this to work, you server must have the mod_rewrite module installed in Apache, but luckily most web hosting companies do.

 

Here is the full .htaccess, but remember, use the mod rewrite rules only if you've installed the script in your uppermost web directory (typically named "www" or "public_html")

 

<Files directory>
ForceType application/x-httpd-php
#SetHandler application/x-httpd-php
#SetHandler application/x-httpd-php5
#ForceType x-httpd-php
</Files>

 

 ## add mod rewrite rules 

RewriteEngine On
RewriteBase /


 #make /directory/ act as index
RewriteRule ^$ /directory/ [L]
RewriteRule ^index\.(php|htm|html)$ /directory/ [R]
RewriteRule ^index\.....$ /directory/ [R]

 

#  Redirect non WWW to WWW
RewriteCond %{HTTP_HOST} ^yourdomain\.com

RewriteRule (.*) http://www.yourdomain.com/$1 [R=301,L]

 

 

 
Tag it:
Delicious, Digg, MyYahoo, Technorati, Furl and 50 more!
Next >

Freelance Jobs

See more freelance oppurtunities

Search

Sponsors

River Connection

Featuring a wide variety of products from manufacturers like Cambridge Welding, Partner Steel, Maravia and Recretec. A full line of inflatable Boat Sealants like Stabond marine adhesives, PVC and hypalon glues, and the exclusive "Boat Doctor" repair kit. Make sure to be prepared for your next whitewater rafting and camping adventure.

http://www.riverconnection.com

Your ad here



Newsflash

Sign up for PayPal and start accepting credit card payments instantly.
Copyright Dew-Code 2008