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

01-03-2011, 10:14 AM
|
|
Contributing Member
Latest Blog: None
|
|
Join Date: 10-29-10
Posts: 539
|
|
|
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?
|

01-03-2011, 10:26 AM
|
 |
v7n Mentor
|
|
Join Date: 12-31-10
Location: London
Posts: 163
|
|
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 10:31 AM.
|

01-04-2011, 05:29 AM
|
|
Contributing Member
Latest Blog: None
|
|
Join Date: 10-29-10
Posts: 539
|
|
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
|

01-04-2011, 07:25 AM
|
 |
Contributing Member
|
|
Join Date: 11-05-10
Posts: 116
|
|
|
|

01-04-2011, 09:10 AM
|
|
Banned
Latest Blog: None
|
|
Join Date: 11-25-10
Posts: 151
|
|
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
|

01-05-2011, 09:59 AM
|
|
Contributing Member
Latest Blog: None
|
|
Join Date: 10-29-10
Posts: 539
|
|
|
I am going to check this out and return with updates. Thank you for helping.
|

01-07-2011, 02:02 AM
|
|
Contributing Member
Latest Blog: None
|
|
Join Date: 10-29-10
Posts: 539
|
|
Tell me more about ajax
|

01-23-2011, 02:44 PM
|
|
Junior Member
|
|
Join Date: 01-23-11
Posts: 13
|
|
Quote:
Originally Posted by davelev
|
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]
|

01-24-2011, 06:54 AM
|
|
Contributing Member
Latest Blog: None
|
|
Join Date: 10-29-10
Posts: 539
|
|
|
OK, but where do I write this?
|

01-24-2011, 05:05 PM
|
 |
Super Moderator
|
|
Join Date: 10-29-07
Location: British Columbia, Canada
Posts: 18,098
|
|
Quote:
Originally Posted by davelev
OK, but where do I write this?
|
Quote:
Originally Posted by sarnatech
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.
|

01-24-2011, 05:11 PM
|
 |
Super Moderator
|
|
Join Date: 10-29-07
Location: British Columbia, Canada
Posts: 18,098
|
|
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.
|
|
Currently Active Users Viewing This Thread: 2 (0 members and 2 guests)
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -7. The time now is 01:16 PM.
Powered by vBulletin Copyright © 2000-2013 Jelsoft Enterprises Limited.
Copyright © 2003 - 2013 Escalate Media LP
|
|
|