Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Rewrite ALL urls with ultimate SEO


Jupiters

Recommended Posts

I noticed that some of my links still use the .php and not .html. My index page still loads as php. Also some of my other links such as the specials.php still load as php or all links in the information box.

 

 

okay heres why:

That's normal because these pages don't need URL rewriting. They never carry parameters like product-info.php.

 

Your homepage is index.php and that's fine, because when that index.php carries parameters (such as /index.php?param1=A&param2=cool.gif then it's rewritten to something like /blabhblah-1A-2B.html).

 

No need to worry.

 

 

anyway: i want to have all urls end with .html . i dont want to irritate my customers. how is that possible?

Link to comment
Share on other sites

I noticed that some of my links still use the .php and not .html. My index page still loads as php. Also some of my other links such as the specials.php still load as php or all links in the information box.

 

 

okay heres why:

That's normal because these pages don't need URL rewriting. They never carry parameters like product-info.php.

 

Your homepage is index.php and that's fine, because when that index.php carries parameters (such as /index.php?param1=A&param2=cool.gif then it's rewritten to something like /blabhblah-1A-2B.html).

 

No need to worry.

 

 

anyway: i want to have all urls end with .html . i dont want to irritate my customers. how is that possible?

 

 

If that is what you want then use Nimmit sef instead .... (By the way Nimmit Sef only work for shops using 1 language)

Link to comment
Share on other sites

If that is what you want then use Nimmit sef instead .... (By the way Nimmit Sef only work for shops using 1 language)

 

 

Hi toyicebear,

 

thx for your answer. really no way to make that with ultimate SEO? i wonder, cause thats the most adviced / promoted contribution for SEO. I would like to use that. especially after reading your comparism. it works quite find with header tags controller, besides. what is your opinion about this one: http://www.magic-seo-url.com/oscommerce/features.html

 

sounds good, especially the duplicate content handling "story". costs 89 Euro, but perhaps i pay that, especially regarding duplicate content.

Link to comment
Share on other sites

You can try to do a htaccess rewrite changing the php edings to html

 

 

The mentioned commercial addon sounds ok, but it has a major drawback..its "encrypted" so you have no access to the code.

 

If something should "break" its functions in the future (which can easily happen due to new versions of PHP and Mysql) you are totaly dependant on the company/person providing it making a fix. And if they as so many other small companies are gone/unreachable by then...well then you are stuck with a broken url system.

Link to comment
Share on other sites

ah okay, i didnt know it was encrypted. okay than i will not buy it.

 

 

i tried to use the htacces respectivly to rewrite it....i didnt work. tried these to variants:

 

 

 

 

RewriteRule ^contact_us\.html$ contact_us.php

 

 

 

RewriteRule /contact_us\.html$ contact_us.php

 

 

none worked. is there something else to do? any suggestions? thx

 

 

 

 

 

 

 

 

You can try to do a htaccess rewrite changing the php edings to html

 

 

The mentioned commercial addon sounds ok, but it has a major drawback..its "encrypted" so you have no access to the code.

 

If something should "break" its functions in the future (which can easily happen due to new versions of PHP and Mysql) you are totaly dependant on the company/person providing it making a fix. And if they as so many other small companies are gone/unreachable by then...well then you are stuck with a broken url system.

Link to comment
Share on other sites

adding something like this to your .htaccess file

 

RewriteRule ^(.*)\.html$ $1.php [nc]

 

Will let you use .html extensions for your .php files

 

if you type in YOUR_WEBSITE/contact_us.html you will be taken to the correct page with .html showing instead of .php

 

 

But you would also need to do some changes so that the links in your website have .html endings.

 

This can be done in includes/classes/seo.class.php

 

by adding this code

 

$link = preg_replace('/.php/', '.html', $link);

 

around line 707 just after this

 

if ( (SEARCH_ENGINE_FRIENDLY_URLS == 'true') && ($search_engine_safe == true) ) {

while (strstr($link, '&&')) $link = str_replace('&&', '&', $link);

$link = str_replace('?', '/', $link);

$link = str_replace('&', '/', $link);

$link = str_replace('=', '/', $link);

$separator = '?';

}

Edited by toyicebear
Link to comment
Share on other sites

Hi toyicebear,

 

 

 

THAT did the trick. really cool. thanks a lot. i did some heavy testing the last 2 hours an everything works. from your point of view, are there any negative things coming up using this (security, missing parameters and therefore missing functionality and so on?) now every .php from the frontend file is rewritten to .html correct?

 

cool thing, ask myself why that isnt in the standard Ultimate SEO contri, dont u?

 

 

 

adding something like this to your .htaccess file

 

 

 

Will let you use .html extensions for your .php files

 

if you type in YOUR_WEBSITE/contact_us.html you will be taken to the correct page with .html showing instead of .php

 

 

But you would also need to do some changes so that the links in your website have .html endings.

 

This can be done in includes/classes/seo.class.php

 

by adding this code

 

 

 

around line 707 just after this

Link to comment
Share on other sites

Hi toyicebear,

 

 

 

THAT did the trick. really cool. thanks a lot. i did some heavy testing the last 2 hours an everything works. from your point of view, are there any negative things coming up using this (security, missing parameters and therefore missing functionality and so on?) now every .php from the frontend file is rewritten to .html correct?

 

cool thing, ask myself why that isnt in the standard Ultimate SEO contri, dont u?

 

I don't use this myself..i have not tested it...it was just some code i made based on your request....

 

But it should not affect anything really...it basically just exchanges .php with .html ...

 

But without testing it extensively in a live enviroment .. its hard to say if there could be any downsides or problems....

 

So keep testing it and if any problems pops up ..do post it in the forum

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...