FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


.htaccess instead of mod_rewrite





jasperlevink
Hello Folks!

I heard it is possible to use .htaccess files instead of the option mod_rewrite to rewrite urls to search engine friendly ones.
I'm not able to enable mod_rewrite so I hope someone can tell me how to do this with .htaccess.

Grtz.
Jasper
mathiaus
mod rewrite is done through .htaccess files and I'm unaware of any other way through htaccess sorry.
dandelion
You might try to use Redirect* directives from the mod_alias module.
mylogz
Mod_rewrite is actually part of the .htaccess stuff. if u dont know anything about .htaccess, here is a brief intro...
it works on Apache server and can b used to do stunts like redirectiing, url rewriting, blocking ips, preventing directory indexing, preventing hotlinking and a whole lot of others
u start by simply creating a file wt a text editor(i recommend notepad on windows) and naming it .htaccess HINT: to force notepad to name the file .htaccess, quote it wt a quotaion mark..as in somthing like ds: ".htaccess"
then ur coding comes in....and u upload it to the directory u want it to work on
here is a snippet from d one im using for my site:
Code:

RewriteEngine on
RewriteRule ^dir/([0-9a-zA-Z\.\-_]+)/([0-9a-zA-Z\.\-_]+).php$ display.php?d=$1&sd=$2



the first line is used to tell d engine im strating some rewriting stunt.
the rewriteRule line means replace any url like www.ngbot.com/dir/arts/arts.php wt www.ngbot.com/display.php?d=arts&sd=arts. so instad of creating a page for every subdirectories and folder for every directories in the site, i redirected them to display.php which actually goes to my db and selects the directory and subdirectory for display Very Happy thats a secret however so dont tell anyone...
for more on htaccess....search something like mod_rewrite in G!....
hope this helps
Simulator
I find this to be the best website:

http://www.workingwith.me.uk/articles/scripting/mod_rewrite/
Related topics
Google and Domains: help
mod_rewrite
.htaccess i mod_rewrite
.htaccess and FTP
[SOLVED] Using mod_rewrite.
only .htaccess instead of mod_rewrite
2 support request and 1 feature request
75FRIH$ Mod_Rewrite Code
How to od URl cloaking?
adding another domain that points to my frihost hosting
How to "folder forward"?
Shortened URL path in php
PHP and .htaccess
Secure log in System
This topic is locked: you cannot edit posts or make replies.    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.