Please login or register.

Login with username, password and session length
Advanced search  

News:

You need/want an older version of sNews ? Download an older/unsupported version here.

Pages: [1] 2

Author Topic: .html extension instreas of /  (Read 6396 times)

adams

  • Newbie
  • *
  • Karma: 0
  • Posts: 4
.html extension instreas of /
« on: May 19, 2007, 03:05:47 pm »

Hi,


I was wondering how to make it so i can have each articlie having .html insead of the '/'.


eg

topic/articlefile.html

instead of

topic/articlefile/

There is a post dealing with this, however i tried to put the line of code into the .htaccess, but it didnt work.


Adam
Logged

bramsyuur

  • Hero Member
  • *****
  • Karma: 23
  • Posts: 873
    • http://snews.vietbee.net
.html extension instreas of /
« Reply #1 on: May 19, 2007, 04:23:48 pm »

Welcome Adam to sNews community! :)
Well, making .html extension is not a big problem ... but my question is... why do you need this? I don't know why...
Logged
La comunidad sNews en tu idioma!
Comunidad sNews en Espaņol

Vinoth

  • Newbie
  • *
  • Karma: 1
  • Posts: 33
.html extension instreas of /
« Reply #2 on: May 19, 2007, 07:52:37 pm »

Yes, sNews is search engine friendly, so we do not need them to change.
Logged

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6020
  • Semantically Challenged
    • snews.ca
.html extension instreas of /
« Reply #3 on: May 20, 2007, 12:05:31 am »

Quote from: Vinoth
Yes, sNews is search engine friendly, so we do not need them to change.
There is absolutely no need to have "html" or "php" or any file extension showing in the URL. It has no bearing on searchability or search-bot identification. sNews uses SEF (search engine friendly) URLs, guaranteed.
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

adams

  • Newbie
  • *
  • Karma: 0
  • Posts: 4
.html extension instreas of /
« Reply #4 on: May 21, 2007, 11:12:46 am »

Thanks for the responses guys.


I have a 6 year old website with over one thousand static html pages. There are so many external links to my content that changing the file locations isnt an option.

How ever staying with static files isnt an option, now that ive seen how useful snews can be, i cant go back :)
Logged

adams

  • Newbie
  • *
  • Karma: 0
  • Posts: 4
.html extension instreas of /
« Reply #5 on: May 22, 2007, 05:29:03 pm »

Ive tried this code but it doesnt work... can someone find the problem for me?


Cheers
Adam



<IfModule mod_php4.c>
    php_value session.use_trans_sid 0
</IfModule>

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^(.*) $1 [L]

RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ index.php?category=$1 [L]

RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([a-z_]+)/([^/]+) index.php?category=$1&title=$2 [L]
RewriteRule ^([a-z_]+)/([^/]+)\.html$ index.php?category=$1&title=$2 [L]

RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([a-z_]+)/([^/]+)/([^/]+)/ index.php?category=$1&title=$2&commentspage=$3 [L]
« Last Edit: August 27, 2007, 03:26:13 am by Phil Martin (Philmoz) »
Logged

bramsyuur

  • Hero Member
  • *****
  • Karma: 23
  • Posts: 873
    • http://snews.vietbee.net
.html extension instreas of /
« Reply #6 on: May 22, 2007, 06:20:05 pm »

@Adams,
To use, for example, an .html extension on your url's, modify your .htaccess and add before:
(The order is important, because, if the first condition don't be ok, the mod_rewrite go to next one)
Quote
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*) index.php?category=$1 [L]
This:
Quote
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*).html$ index.php?category=$1 [L]
With this modification, you can access to your pages like:
http://your-site.com/home/my-article/
and
http://your-site.com/home/my-article.html
Cheers! ;)
Logged
La comunidad sNews en tu idioma!
Comunidad sNews en Espaņol

adams

  • Newbie
  • *
  • Karma: 0
  • Posts: 4
.html extension instreas of /
« Reply #7 on: May 23, 2007, 12:51:39 pm »

hi,

Thanks for your help, i really appreciate it.

Yes this works..

However, all the links in the category pages still point to the '/' version. How can I change this to make the .html the default.


Will the be an issue of duplicte content if have both .html & '/' extension.

Adam
Logged

ajayvibha

  • Newbie
  • *
  • Karma: -1
  • Posts: 28
    • http://www.obiztek.com
.html extension instreas of /
« Reply #8 on: July 23, 2007, 07:05:58 am »

I am also looking for .html extension before I use SNEWS for some sites where many of existing page are having html extension.Using Redirection etc ios no possible overnight to preserve the ranking .


After following the tips given in this post all the links in the category pages still point to the '/' version.

Is there solution around ?
Logged
Regards,
AjayVibha
Online Business Technologies (OBizTek)
SEO | Hosting | Design

Joost

  • Guest
.html extension instreas of /
« Reply #9 on: July 23, 2007, 02:47:55 pm »

Redirects should not have a negative influence on pagerank. That is, if the redirects are implemented correctly (301). If the content  of the old pages doesn't change, you might as well leave them as they are.
Logged

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6020
  • Semantically Challenged
    • snews.ca
.html extension instreas of /
« Reply #10 on: July 23, 2007, 03:29:22 pm »

@ ajay...
Try the second resource link under this post in the Resources Forum. The "Stupid .htaccess Tricks" site has a reference to using Redirect 301 at the bottom of the Redirects link group.
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

ajayvibha

  • Newbie
  • *
  • Karma: -1
  • Posts: 28
    • http://www.obiztek.com
.html extension instreas of /
« Reply #11 on: July 23, 2007, 05:39:56 pm »

I know that Redirect 301 does not affect ranking as such.

But my basic question remain same whether it is possible to have .html extesnion for pages & category both ? There is need to maintain existing file structure "as it is where it is " by the concerned website owners.

Is that possible ?
Logged
Regards,
AjayVibha
Online Business Technologies (OBizTek)
SEO | Hosting | Design

Joost

  • Guest
.html extension instreas of /
« Reply #12 on: July 23, 2007, 06:17:03 pm »

Yes, ajayvibha, it is possible. Go to the page that Keyrocks suggested. Search for: 'Disguise Script Extensions'
You probably have to combine it with some other tricks.

On second thought, after reading the thread (I assumed you did too, ajayvibha ) the answer is somewhere on this page. :P
Logged

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6020
  • Semantically Challenged
    • snews.ca
.html extension instreas of /
« Reply #13 on: July 23, 2007, 08:15:51 pm »

@ Ajay... Keep in mind that Bramsyuur's .htaccess mod in Post #7 does not add .html to the end of categories and articles in the URLs... but it will recognize a request for a same-named URL that has an .html extension in the request... and lead the request-er to the article by that name in that category if it exists in your sNews site.
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

ajayvibha

  • Newbie
  • *
  • Karma: -1
  • Posts: 28
    • http://www.obiztek.com
Re: .html extension instreas of /
« Reply #14 on: August 26, 2007, 01:39:12 pm »

Yes Keyrocks , I can see your point that with above htaccess modification it will only recognize the URL with .html extension but will not generate it.

But what I am looking for is the generation of .html extension pages so that

instead of URL generation of
www.domainname.com/home/my-article/

it will generate URL like
http://www.domainname.com/home/my-article.html

At the program change level I think that it should not be much difficult as it is a matter of allowing ".html" instead of "/" in the relevant area of URL generation.I would like to do that myself but understanding & debugging snews.php will take lot of time which may affect the adaption process of snews.

Can you please give your expert comments.
Logged
Regards,
AjayVibha
Online Business Technologies (OBizTek)
SEO | Hosting | Design
Pages: [1] 2