Welcome to the IMTalk - Internet Marketing & SEO Forum.
  • Login:
+ Reply to Thread
Results 1 to 7 of 7
  1. #1
    JustGoWithIt's Avatar
    JustGoWithIt is offline IM & SEO Talker JustGoWithIt is just really nice JustGoWithIt is just really nice JustGoWithIt is just really nice JustGoWithIt is just really nice
    Join Date
    Jul 2010
    Location
    Right there!
    Posts
    2,192
    Thanks Given
    93
    Thanked 341 Times in 214 Posts

    How to hide html extension in the URL?

    Hi guys,

    I need your help to hide domain extension in a page.

    I created a html file (free-gift.html) in the root directory and the WordPress is also installed in the same directory.

    The final result leads to this page: Instant Cash Systems

    Now I want to hide .html extension in this URL. How can I do it?

    The default .htaccess is already configured for .php extension (for WordPress) and I tried for .html extension, but didn't work (a wild 500 internal error page appears).

    Your help is appreciated
    Last edited by JustGoWithIt; 10-23-2012 at 05:49 PM.
    Hello there.

  2. #2
    proseocontent's Avatar
    proseocontent is offline IM & SEO Small Talker proseocontent has a spectacular aura about proseocontent has a spectacular aura about proseocontent has a spectacular aura about
    Join Date
    May 2011
    Location
    germany
    Posts
    903
    Thanks Given
    48
    Thanked 222 Times in 173 Posts
    This is for complete rewriting url and hide html and php

    PHP Code:
    RewriteEngine On
    RewriteBase 
    /
    RewriteCond %{HTTP_HOST} !^www\.yordomain\.com [NC]
    RewriteRule ^/?(.*) http://www.yourdomain.com/$1 [L,R=301]

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond 
    %{REQUEST_FILENAME} !-d
    RewriteCond 
    %{REQUEST_FILENAME}.html -f


    RewriteRule 
    ^(.*)$ $1.html

    RewriteCond 
    %{REQUEST_FILENAME}.php -f
    RewriteRule 
    ^(.*)$ $1.php 

  3. #3
    JustGoWithIt's Avatar
    JustGoWithIt is offline IM & SEO Talker JustGoWithIt is just really nice JustGoWithIt is just really nice JustGoWithIt is just really nice JustGoWithIt is just really nice
    Join Date
    Jul 2010
    Location
    Right there!
    Posts
    2,192
    Thanks Given
    93
    Thanked 341 Times in 214 Posts
    It doesn't work. I got same internal error again. Any idea?

    Quote Originally Posted by proseocontent View Post
    This is for complete rewriting url and hide html and php

    PHP Code:
    RewriteEngine On
    RewriteBase 
    /
    RewriteCond %{HTTP_HOST} !^www\.yordomain\.com [NC]
    RewriteRule ^/?(.*) http://www.yourdomain.com/$1 [L,R=301]

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond 
    %{REQUEST_FILENAME} !-d
    RewriteCond 
    %{REQUEST_FILENAME}.html -f


    RewriteRule 
    ^(.*)$ $1.html

    RewriteCond 
    %{REQUEST_FILENAME}.php -f
    RewriteRule 
    ^(.*)$ $1.php 
    Hello there.

  4. #4
    wink0r's Avatar
    wink0r is offline Moderator wink0r is a splendid one to behold wink0r is a splendid one to behold wink0r is a splendid one to behold wink0r is a splendid one to behold wink0r is a splendid one to behold wink0r is a splendid one to behold wink0r is a splendid one to behold
    Join Date
    Oct 2010
    Location
    East Coast, USA
    Posts
    2,183
    Thanks Given
    941
    Thanked 651 Times in 491 Posts
    You could create a directory in your site root called free-gift and put your page in the directory and rename it index.html. The official link would be yoursite.com/free-gift/, but the browser would supply the trailing '/' so yoursite.com/free-gift should work fine.

  5. The Following User Says Thank You to wink0r For This Useful Post:


  6. #5
    JustGoWithIt's Avatar
    JustGoWithIt is offline IM & SEO Talker JustGoWithIt is just really nice JustGoWithIt is just really nice JustGoWithIt is just really nice JustGoWithIt is just really nice
    Join Date
    Jul 2010
    Location
    Right there!
    Posts
    2,192
    Thanks Given
    93
    Thanked 341 Times in 214 Posts
    Thanks wink! I'm going to try this out..

    EDIT: It worked! Thanks alot wink!

    Quote Originally Posted by wink0r View Post
    You could create a directory in your site root called free-gift and put your page in the directory and rename it index.html. The official link would be yoursite.com/free-gift/, but the browser would supply the trailing '/' so yoursite.com/free-gift should work fine.
    Last edited by JustGoWithIt; 10-22-2012 at 09:36 AM.
    Hello there.

  7. #6
    wink0r's Avatar
    wink0r is offline Moderator wink0r is a splendid one to behold wink0r is a splendid one to behold wink0r is a splendid one to behold wink0r is a splendid one to behold wink0r is a splendid one to behold wink0r is a splendid one to behold wink0r is a splendid one to behold
    Join Date
    Oct 2010
    Location
    East Coast, USA
    Posts
    2,183
    Thanks Given
    941
    Thanked 651 Times in 491 Posts
    Good deal, but now the link in your first post is broken.

  8. The Following User Says Thank You to wink0r For This Useful Post:


  9. #7
    JustGoWithIt's Avatar
    JustGoWithIt is offline IM & SEO Talker JustGoWithIt is just really nice JustGoWithIt is just really nice JustGoWithIt is just really nice JustGoWithIt is just really nice
    Join Date
    Jul 2010
    Location
    Right there!
    Posts
    2,192
    Thanks Given
    93
    Thanked 341 Times in 214 Posts
    Quote Originally Posted by wink0r View Post
    Good deal, but now the link in your first post is broken.
    Just fixed it
    Hello there.


 

Similar Threads

  1. High Page Rank Domain List For My Forum Member
    By welzap in forum Free Stuff
    Replies: 5
    Last Post: 05-17-2012, 06:26 AM
  2. Hide my IP
    By rain22 in forum Get Reviewed (Your Websites, SEO, Designs, Tools...)
    Replies: 11
    Last Post: 10-04-2011, 09:26 PM
  3. [ASK] How to Hide Internal Links?
    By JudderMan in forum On-Page SEO & Content Creation
    Replies: 7
    Last Post: 09-09-2011, 02:26 AM
  4. How to hide website content?
    By Hajoless in forum On-Page SEO & Content Creation
    Replies: 4
    Last Post: 07-04-2011, 05:17 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts