Forum Moderators: phranque

Message Too Old, No Replies

How to remove "lang,en/" from URLs?

Am I messing with the comma?

         

Biggus_D

2:45 am on Apr 2, 2007 (gmt 0)

10+ Year Member



I'm trying to get rid of the final "lang,en/" but I'm having a hard time trying to find the solution.

The URLs are now like

www.example.com/path/filenumber/lang,en/

And I want (really need to keep SERPs) them to be:

www.example.com/path/filenumber/

I've tried several combinations but I think that maybe is due the "," character:

RewriteRule ^([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)$ lang\,en/$1 [R=301,L]

Any idea?

Thank you very much

[edited by: jdMorgan at 4:05 am (utc) on April 2, 2007]
[edit reason] Example.com [/edit]

jdMorgan

6:34 pm on Apr 2, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You'll need to change the links on your pages if you want to "change the URL." The "real" URL is determined by the links on your pages, while the "real" filepath is determined by your placement of files on your server.

So the links determine what will appear in search engine listings, while mod_rewrite can then be used in the URL-to-filename translation phase of server processing to map the URL back to the actual filepath of the desired content.

As mod_rewrite makes clear, URLs and filepaths are not the same thing, and in fact, need not have any fixed relationship with each other. A URL is a locator for use on the Web, while a filepath is a locater for use inside the server filesystem. mod_rewrite sits between the Web and the server filesystem, and can take part in the URL-to-filename translation.

RFC 2396 [faqs.org] defines the characters which are valid within the various URI components, and a comma is a reserved character. Therefore, I recommend that you change your URL convention to use an unreserved character, such as "-" or "_".

Jim