Hello I want to create .htaccess file in PHP and for website why do we require to have this file. means what are the advantage if I create.
how to create .htaccess file in PHP
Collapse
X
-
Tags: None
-
.htaccess files are good for many things. One of the more notable possibilities with using .htaccess is the creation of 'pretty urls' where you take a url that looks likeOriginally posted by mukeshrasmHello I want to create .htaccess file in PHP and for website why do we require to have this file. means what are the advantage if I create.
Quite ugly, no? And change it into this:Code:www.somesite.com/?id=this&item=is&auth=now&p=pretty
Looks alot better, right?Code:www.somesite.com/this/is/now/pretty
This is all done with simple RewriteRule's
I've heard .htaccess files are pretty resource intensive though.. meaning theyre bandwidth hungry. Not sure about the credibility of this statement, though.
Hope this helps! -
Thanks for the information. But how can I create .htaccess fileOriginally posted by markusn00b.htaccess files are good for many things. One of the more notable possibilities with using .htaccess is the creation of 'pretty urls' where you take a url that looks like
Quite ugly, no? And change it into this:Code:www.somesite.com/?id=this&item=is&auth=now&p=pretty
Looks alot better, right?Code:www.somesite.com/this/is/now/pretty
This is all done with simple RewriteRule's
I've heard .htaccess files are pretty resource intensive though.. meaning theyre bandwidth hungry. Not sure about the credibility of this statement, though.
Hope this helps!Comment
-
ok but how the url wil look like thisOriginally posted by markusn00bCreate a file, any file, then save the file named as .htaccess
Simple.
www.somesite.co m/this/is/now/pretty
as you have given example above.Comment
-
Well you need to create a rule inside the file.Originally posted by mukeshrasmok but how the url wil look like this
www.somesite.co m/this/is/now/pretty
as you have given example above.
Try a tutorial on rewritingComment
Comment