Webmaster Forum

Go Back   Webmaster Forum > Web Development > Coding Forum

Coding Forum Problems with your code? Discuss coding issues, including JavaScript, PHP & MySQL, HTML & CSS, Flash & ActionScript, and more.


Closed Thread
 
LinkBack Thread Tools Display Modes
Share |
  #1 (permalink)  
Old 01-03-2011, 11:14 AM
Contributing Member
Latest Blog:
None

 
Join Date: 10-29-10
Posts: 539
iTrader: 0 / 0%
How to hide page file in URL?

I see lots of sites with URLs like:

(these are not real URLs below, don't try them!)
www.travel.com
www.travel.com/flights
www.travel.com/flights/international

My sites always show:
www.travel.com/index.php
www.travel.com/flights/index.php
www.travel.com/flights/international/blabla.php

So... these URLs show the TLDs, the directories, but never the page files themselves (.htm, .php etc...)

How to do this? By the way: I have static pages, of course...

And: if we can hide them, is that a problem in backlinking, SEO, search engine indexing, whatsoever?

 

Advertisement

Advertisement

  #2 (permalink)  
Old 01-03-2011, 11:26 AM
-10's Avatar
-10 -10 is offline
v7n Mentor
Latest Blog:
TUI Cluburlaub

 
Join Date: 12-31-10
Location: London
Posts: 163
iTrader: 0 / 0%
You can use .htaccess redirects

As far as I know it doesn't affect SEO though if your inbounds get split between flights/ and flights/index.php they won't count for each other's rankings.

I think this would work:

Code:
IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule . /index.php [L] </IfModule>

Last edited by -10; 01-03-2011 at 11:31 AM.
 
  #3 (permalink)  
Old 01-04-2011, 06:29 AM
Contributing Member
Latest Blog:
None

 
Join Date: 10-29-10
Posts: 539
iTrader: 0 / 0%
Wait... I should edit my .htaccess file?

I was wondering if there is a single script that can modify my whole site, all the URLs
 
  #4 (permalink)  
Old 01-04-2011, 08:25 AM
johneva's Avatar
Contributing Member
 
Join Date: 11-05-10
Posts: 116
iTrader: 0 / 0%
This may help.

http://www.websiteoptimization.com/speed/tweak/rewrite/
__________________
Contract Hire - Total Fleet Services, UK vehicle leasing company
Fleet Management - Total Fleet Management
 
  #5 (permalink)  
Old 01-04-2011, 08:51 AM
No Longer Active
Latest Blog:
None

 
Join Date: 12-10-10
Posts: 41
iTrader: 0 / 0%
Actually when applying codes using htaccess, you're not necessarily hiding the url, instead your just redirecting, securing, reforming your website url to be more readable, organized and SEO friendly. It's sort of declaring what is the url address you prefer for a webpage.

Check:
htaccess - Security for webmasters
5 useful url rewriting examples using .htaccess
Create SEO Friendly URLs With Htaccess Mod Rewrite in 3 Easy Steps
 
  #6 (permalink)  
Old 01-04-2011, 10:10 AM
Banned
Latest Blog:
None

 
Join Date: 11-25-10
Posts: 151
iTrader: 0 / 0%
Hello,

By editing the .htaccess, you specify the directories to redirect and those to not, and by doing that, you can specify to apply those rules to the whole website, without needing to edit everything alone.
The .htaccess solution provided above is the safer and best (SEO point) solution for doing this type of changes, even scripts that you may find online will use same methods, so it will be better that you do it by yourself, from time to learn something new
 
  #7 (permalink)  
Old 01-05-2011, 10:59 AM
Contributing Member
Latest Blog:
None

 
Join Date: 10-29-10
Posts: 539
iTrader: 0 / 0%
I am going to check this out and return with updates. Thank you for helping.
 
  #8 (permalink)  
Old 01-07-2011, 03:02 AM
Contributing Member
Latest Blog:
None

 
Join Date: 10-29-10
Posts: 539
iTrader: 0 / 0%
Tell me more about ajax
 
  #9 (permalink)  
Old 01-07-2011, 06:48 AM
Contributing Member
Latest Blog:
None

 
Join Date: 10-29-10
Posts: 539
iTrader: 0 / 0%
How about just hiding the extension .php, .htm?

I will keep everything, so they will look like:

www.mysite.com/folder/page

instead of:

www.mysite.com/folder/page.php
 
  #10 (permalink)  
Old 01-23-2011, 03:44 PM
Junior Member
 
Join Date: 01-23-11
Posts: 13
iTrader: 0 / 0%
Quote:
Originally Posted by davelev View Post
How about just hiding the extension .php, .htm?

I will keep everything, so they will look like:

www.mysite.com/folder/page

instead of:

www.mysite.com/folder/page.php
Example for removing file extentions for .html pages, it can be adopted to other files as well.

Code:
RewriteEngine on # ## Internally rewrite extensionless file requests to .html files ## # # If the requested URI does not contain a period in the final path-part RewriteCond %{REQUEST_URI} !(\.[^./]+)$ # and if it does not exist as a directory RewriteCond %{REQUEST_FILENAME} !-d # and if it does not exist as a file RewriteCond %{REQUEST_FILENAME} !-f # then add .html to get the actual filename RewriteRule (.*) /$1.html [L] # # ## Externally redirect clients directly requesting .html page URIs to extensionless URIs # # If client request header contains html file extension RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^.]+\.)+html\ HTTP # externally redirect to extensionless URI RewriteRule ^(.+)\.html$ http://www.example.com/$1 [R=301,L]
 
  #11 (permalink)  
Old 01-24-2011, 07:54 AM
Contributing Member
Latest Blog:
None

 
Join Date: 10-29-10
Posts: 539
iTrader: 0 / 0%
OK, but where do I write this?
 
  #12 (permalink)  
Old 01-24-2011, 06:05 PM
HTMLBasicTutor's Avatar
Administrator
 
Join Date: 10-29-07
Location: Canada
Posts: 25,709
iTrader: 5 / 100%
Quote:
Originally Posted by davelev View Post
OK, but where do I write this?
Quote:
Originally Posted by sarnatech View Post
Hello Friends,

1.If you are using a custom theme, some of the following may not apply, depending on how much you have altered the templates.
2.You can use the skin.css, portal.css or module.css file for this customization. I personally recommend changing the portal.css file.
3. Open the Portal.css file in your favorite text/html editor. The file is located in the Portals/{portalId}/ directory.
4. Add this to the very bottom of the file if you wish to hide the URL on the Group Details page:

Thanks
This not applicable to your problem Dave, they copied and pasted from here just to get a post count without reading the whole thread.
__________________

HTML Basic Tutor - Learn how to code for better SEO
Basic Computer Information - Computer & internet basics for website owners

SEO troubleshooting and review services available. - Pm me.
 
  #13 (permalink)  
Old 01-24-2011, 06:11 PM
HTMLBasicTutor's Avatar
Administrator
 
Join Date: 10-29-07
Location: Canada
Posts: 25,709
iTrader: 5 / 100%
Dave,
Why are you wanting to do this?

Is this an existing site you are doing this to?

If so, It will affect your SEO if not handled properly. FYI: flights/page is different from flights/page.htm (or any other extension) in the eyes of the SEs.

Quote:
Website Redesign
Whether it is an overhaul of your existing site using the same technology as it had originally or if you have decided to change the technology used to run your site you need to keep track of all changes and use 301 permanent redirects to point to the new format or new web page file names. Examples:
Whole article: 301 Redirects: What You Need to Know

If you are trying to hide the technology you are using, that won't work either. If they are determined to figure it out all they have to do is a header check.
__________________

HTML Basic Tutor - Learn how to code for better SEO
Basic Computer Information - Computer & internet basics for website owners

SEO troubleshooting and review services available. - Pm me.
 
Go Back   Webmaster Forum > Web Development > Coding Forum

Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to insert php file in wordpress post or page globalcashsite Coding Forum 5 11-08-2010 07:25 PM
Cannot get PDF file to open from HTM page danc Tech Talk 1 07-19-2009 11:03 AM
Having same text on every page by only editing one file? games_master Coding Forum 6 01-03-2006 02:00 AM


V7N Network
Get exposure! V7N I Love Photography V7N SEO Blog V7N Directory


All times are GMT -7. The time now is 05:53 AM.
Powered by vBulletin
Copyright 2000-2014 Jelsoft Enterprises Limited.
Copyright © 2003 - 2014 Escalate Media




Search Engine Optimization by vBSEO 3.6.0 RC 2 ©2011, Crawlability, Inc.