SEO | Link Popularity | Search Engine Consulting | SEO Tutorial | SEO Tools | SEO Forum
Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 04-12-2006, 04:50 PM
blogmaster2003's Avatar
blogmaster2003 blogmaster2003 is offline
SEO Junior and a half
 
Join Date: Feb 2006
Posts: 56 blogmaster2003 is on a distinguished road
Simple rewrite rules from php to html pages

Hi

I need someone help me with this:


I have several pages ending .php

I need to rewrite them to end in .html

I also need to change the name of the url: example:

curently i have: www.domain.com/2345.php

2345.php has a <title> and i want it looks like:

www.domain.com/title.html


I know i have to put some code in .htacess file, but i tried to read, read, read and canīt get nothing

Thank you for your reading this.
__________________
easy free forum host
fast free forum host
Reply With Quote
  #2  
Old 04-14-2006, 01:40 AM
blogmaster2003's Avatar
blogmaster2003 blogmaster2003 is offline
SEO Junior and a half
 
Join Date: Feb 2006
Posts: 56 blogmaster2003 is on a distinguished road
hmm

nobody?

nothing?

__________________
easy free forum host
fast free forum host
Reply With Quote
  #3  
Old 04-14-2006, 02:23 AM
Paz's Avatar
Paz Paz is offline
SEO GUY Moderator
 
Join Date: Sep 2004
Location: Antalya, Turkey
Posts: 4,118 Paz has a spectacular aura aboutPaz has a spectacular aura about
Hi,

Can I ask first, so you have any php coding in the existing files or are they just straight html?

If they are straight html, you can use something like this in your htaccess:

Options +Indexes
Options +FollowSymlinks
RewriteEngine on
RewriteBase /
RewriteRule ^(.*)\.html$ $1.php [L]

Don't forget though, rewriting your urls is a major step that shouldn't be taken lightly. Static files with php extensions will rank just as well as html documents, in my experience.

Cheers,
Paz.
__________________
10.3 million entries for Hotels in Turkey but I'm still chipping away.
Reply With Quote
  #4  
Old 04-14-2006, 03:07 AM
blogmaster2003's Avatar
blogmaster2003 blogmaster2003 is offline
SEO Junior and a half
 
Join Date: Feb 2006
Posts: 56 blogmaster2003 is on a distinguished road
hmmm

You are right.

I expressed bad and i think i canīt have them like html.

I need to get the urls insted of

domain.com/12345.php

to

domain.com/title-of-the-123456.php

??

Thank you.
__________________
easy free forum host
fast free forum host
Reply With Quote
  #5  
Old 04-14-2006, 10:45 AM
Paz's Avatar
Paz Paz is offline
SEO GUY Moderator
 
Join Date: Sep 2004
Location: Antalya, Turkey
Posts: 4,118 Paz has a spectacular aura aboutPaz has a spectacular aura about
Haha, well maybe I wasn't thinking straight either, but as I understand it you can also use htaccess to parse html files as though they were php files. I'm not sure if you can combine url rewriting and parsing at the same time though.

Also I'm not sure if what you want to do is worth the trouble. It's nice to have keywords in the url, but the disruption it will cause to your site may make it unproductive.

Anyway here we go:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.domain.com$
RewriteCond %{REQUEST_URI} !^/some-title.*
RewriteRule ^(.*)$ /some-title$1


Cheers,
Paz.
__________________
10.3 million entries for Hotels in Turkey but I'm still chipping away.
Reply With Quote
  #6  
Old 04-18-2006, 12:31 PM
blogmaster2003's Avatar
blogmaster2003 blogmaster2003 is offline
SEO Junior and a half
 
Join Date: Feb 2006
Posts: 56 blogmaster2003 is on a distinguished road
Thank you Paz. It worked ok.

This is the subject about seo/servers/languages i dontīreally understand almost nothing, you gave me a big help, thank you very much.
__________________
easy free forum host
fast free forum host
Reply With Quote
  #7  
Old 04-20-2006, 07:28 AM
guybrush guybrush is offline
SEO
 
Join Date: Dec 2004
Posts: 220 guybrush will become famous soon enough
hi paz

Will greatly appreciate your help in the following:

i have this url:
http://www.xyz.com/article.php?titl...e_article_title

what should do to make it look like this:
http://www.xyz.com/news/this_is_the_article_title
Reply With Quote
  #8  
Old 04-20-2006, 08:39 AM
Paz's Avatar
Paz Paz is offline
SEO GUY Moderator
 
Join Date: Sep 2004
Location: Antalya, Turkey
Posts: 4,118 Paz has a spectacular aura aboutPaz has a spectacular aura about
Hi Guybrush,

Are you sure you really want to do this? Yahoo and Google are getting quite good at indexing dynamic urls, especially if you only have one variable.

If the pages are indexed already I wouldn't bother.

But if you must, you can try this:


Options +Indexes
Options +FollowSymlinks
RewriteEngine on
RewriteBase /
RewriteRule ^news/(.*)\.html$ article.php?title=$1 [L]

I've added an .html for you, but you can change it to .htm as nec
If you don't want either then you should be able to delete the \.html bit; but I've never tested that. Let me know how you get on.

Cheers,
Paz.
__________________
10.3 million entries for Hotels in Turkey but I'm still chipping away.
Reply With Quote
  #9  
Old 04-20-2006, 11:21 AM
guybrush guybrush is offline
SEO
 
Join Date: Dec 2004
Posts: 220 guybrush will become famous soon enough
Advice accepted and the rewrite idea dropped.

By the way, the site aint in operation yet so no harm wouldve been done. Actually its a news site and felt that the "article.php" in the url could be misleading.

many many thanks.
Reply With Quote
  #10  
Old 04-20-2006, 02:10 PM
Paz's Avatar
Paz Paz is offline
SEO GUY Moderator
 
Join Date: Sep 2004
Location: Antalya, Turkey
Posts: 4,118 Paz has a spectacular aura aboutPaz has a spectacular aura about
Quote:
Originally Posted by guybrush
Advice accepted and the rewrite idea dropped.

By the way, the site aint in operation yet so no harm wouldve been done. Actually its a news site and felt that the "article.php" in the url could be misleading.

many many thanks.


haha well sorry for any confusion, but if it's a new site then I'd go for it! It's a simple enough mod, and I always thing static htmls look more attractive in the serps listings.

Cheers,
Paz.
__________________
10.3 million entries for Hotels in Turkey but I'm still chipping away.
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


Login/Register
User Name
Password
Remember Me?

Forum Links
Forum Home
SEO Forum
Internet Marketing Forum
Web Design Forum
Web Hosting Forum
Programming Forum
SEO Chat

Quick Links
Forum Home
New Posts
Mark Forums Read
Open Buddy List
User Control Panel
Edit Avatar
Edit Profile
Edit Options
Miscellaneous
Subscribed Threads
My Profile

Search Forums

Advanced Search
All times are GMT -8. The time now is 02:05 AM.


Powered by: vBulletin Version 3.0.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.