I'm a newbie, how to make a website like this: domain.com/something, instead of domain.com/something.html or domain.com/something.php or domain.com/something.shmtl use .htaccess?
Can you give me example? I'm confused ..... I searched and found redirect bob.html to alice.html. I don't want to redirect to different page though
Open all php files , convert all link from *.php to *.html create a .htaccess file write in it RewriteEngine On RewriteRule ^index.html$ index.php RewriteRule ^register.html$ register.php etc...
You could use some free CMS and you also could get a better seo for your site, i think that's why you want to change the extension
Since you said you're a newbie: /something is a directory, create it first. something.html, something.php etc. are files inside that directory. domain.com/something will automatically open the index.html or index.php file in that directory. if you don't have or don't want an "index.ext" file, if you want some other file to open by default, then you have to write it in .htaccess like - "DirectoryIndex otherfilename.ext" (without the quotes)
you should use something like Options +FollowSymlinks RewriteEngine on RewriteRule ^(.*)\.htm$ $1.php [NC] Code (markup):
hi http://forums.digitalpoint.com/member.php?u=504591 explained what he want, i'm confused why you need to know it's php or html
Same here, he did not ask to rename from html to php or php to html And I already said, mod_rewrite is the solution. Google for mod_rewrite extensionless
That's not what I wanted. I wanted to make mysite.com/index.php into mysite.com/index For example, i have page called page.php, I wanted to make it to mysite.com/page and there's no folder "page" in my web, if visitors type mysite.com/page, they'll be redirected to page.php, but in their browser bar it's shown as mysite.com/page I tried using RewriteEngine On RewriteRule ^index$ index.php Code (markup): It worked in my own server, but it didn't work in my web hosting's server, it said the page isn't redirecting properly. Man I'm confused.....
Your code worked my web hosting RewriteEngine On RewriteRule ^index$ index.php RewriteRule ^index/$ index.php
Options +FollowSymLinks +Indexes RewriteEngine on RewriteBase / RewriteRule ^(.*)\.html$ $1.php [R=301,L]
If you're not sure if there's going to be a trailing slash, use a question mark: RewriteRule ^index/?$ index.php Also, for the index/main page, I wouldn't use /index - I'd simply use / - the regular web site URL. This trick is best for when you have cases where a directory like that makes sense: RewriteRule ^register/?$ regform.php or RewriteRule ^shoes/?$ store.php?type=5 ETA: The [R=301] is only necessary when moving a page to a new location. So if you're starting fresh on a site, you don't need it. On the other hand, if you're moving from one URL to another (like blah.com/register to blah.com/signup you'll want to use a 301 redirect. RewriteRule ^register/?$ /signup [R=301]
Thanks guys. I actually wanted to remove the page extension so the visitors can easily type it in their browser because I think domain.com/page is better than domain.com/page.php