This forum has been moved here:
Helicon Tech Community Forum

  Active TopicsActive Topics  Display List of Forum MembersMemberlist  HelpHelp   RegisterRegister  LoginLogin
Common Questions (Forum Locked Forum Locked)
 Helicon Tech : Common Questions
Subject Topic: Easy way to convert to lower-case? (Topic Closed Topic Closed)
Author
Message |
bjimpson
Newbie


Joined: 19 August 2004
Location: United States
Posts: 1
Posted: 19 August 2004 at 2:26pm  

Is there an easy way to rewrite all URLs to be lower case?

I would like to give a 301 Permanent Redurect from, e.g,

www.widgets.com/Products to www.widgets.com/Products etc.

The purpose in this is that search engines think that Products and products may be different pages (which they could very well be).  This could adversely affect PageRank.

Back to Top
 
Yaroslav
Admin Group


Joined: 15 August 2002
Posts: 6520
Posted: 20 August 2004 at 4:52am  

Example - write the following rule:

RewriteRule ([^?]*\u.*) /redirect.asp\?$1

This will direct all requests with uppercase characters in it to the redirect.asp page and original URL will be in QueryString. After that you will be able to lowercase this URL and isue a redirect from that page.



__________________
Yaroslav Govorunov,
Helicon Tech
Back to Top Visit Yaroslav's Homepage
 
-KC-
Newbie


Joined: 07 October 2004
Location: United States
Posts: 3
Posted: 07 October 2004 at 1:01pm  

No.. that's not gonna work for me I don't think...

I run Froums, and all member tracking and conformation is done through cookies.

Cookies however are case sensitive by the root subdirectory they are made from.

e.g. if someone logs on to mydomain.com/TEST and then clicks a link to some web page at mydomain.com/test they loose their cookie and login.

(Snitz forums if anyone was interested)

It might be possible to change the forum code, but since I have so many pages and forums, I want to make ALL http url requests convert to lower case as far as cookies are concerned.

Is that feasible? or would it drop my Win2K server to it's knee's?

I know it is a cookie problem, and poor planning on my part to use upper case in my subdiretory names and code, but I have thousands of pages over four main sbubdiretories with one 8 years old now.

Any suggestions?



__________________
Back to Top
 
Yaroslav
Admin Group


Joined: 15 August 2002
Posts: 6520
Posted: 08 October 2004 at 5:44am  

Here is a rule that will direct all requests with any uppercase character to the /redirect.asp page providing original ULR as Query string. Then you may convert URL to lowercase and issue a redirect from the redirect.asp code:

RewriteRule (?![^\u]+$)(.*) /redirect.asp$1

Remember not to issue redirect with uppercase character or you will fall into a loop.

__________________
Yaroslav Govorunov,
Helicon Tech
Back to Top Visit Yaroslav's Homepage
 
-KC-
Newbie


Joined: 07 October 2004
Location: United States
Posts: 3
Posted: 08 October 2004 at 10:35am  

Can't we skip the redirect to another page and just make the whole string lower case in one shot and then send it thru?

Thats what I do for stripping out any www. 's in a url, here is the code I use for that.

# Strip out the www. and redirect.
RewriteCond Host: www\.vales\.com
RewriteRule (.*) http\://vales.com$1 [I,R]

Actually, I guess it would get a bit complicated if it just flat made everything lower case because of querystring forms...

Some form fields after the url string ?variable= might indeed need to be capitol letters... idea's?



__________________
Back to Top
 
-KC-
Newbie


Joined: 07 October 2004
Location: United States
Posts: 3
Posted: 08 October 2004 at 10:45am  

I have an idea... There are actually only 4 subdirectory names whose case affect my cookies, /MTM2/, /Evo1/, /Evo2/ and /XR/.

All I need to do is the same thing I do to strip out www. right? Look for each of the 4 subs regardless of case, and redirect them with the cases above right?

It doesn't matter if it's all upper, lower, mixed, whatever, just so it is always the same.



__________________
Back to Top
 
Yaroslav
Admin Group


Joined: 15 August 2002
Posts: 6520
Posted: 08 October 2004 at 2:32pm  

And why you don't want to try my suggestion?



__________________
Yaroslav Govorunov,
Helicon Tech
Back to Top Visit Yaroslav's Homepage
 
BSindia
Newbie


Joined: 12 October 2004
Location: India
Posts: 2
Posted: 12 October 2004 at 6:29am  

Yes, that is correct! First try his suggestion and revert back us, if you have any problem, so that we can suggest you any other option!

I feel this suggestion will solve your issue!

 

 



__________________
Cheap web hosting
bsindia.com - Windows 2003
server,ASP.Net,ASP,Miva merchant New,
Professional support, all starting from $3.33/month
Back to Top Visit BSindia's Homepage
 
musosmiffy
Newbie


Joined: 11 May 2009
Location: United Kingdom
Posts: 6
Posted: 11 May 2009 at 2:04am  

Hi,

This is the solution I have been looking for:
RewriteRule ([^?]*\u.*) /redirect.asp\?$1

However, any URL's with a querystring - the querystring is removed ie
http://www.website.co.uk/admin-new/Browse.asp?ocdGridMode_A=Search&sqlfrom_A=%5BSchoolDB%5D
becomes
http://www.driving-schools-directory.co.uk/admin-new/browse.asp

Any ideas please? I use ISAPI 3

Thanks.
Back to Top
 
Anton
Admin Group


Joined: 30 January 2007
Location: Ukraine
Posts: 10519
Posted: 12 May 2009 at 5:22am  

Could you please explain what are you trying to achieve and if possible please start a new post on the forum.

__________________
Regards,
Anton
Back to Top
 
musosmiffy
Newbie


Joined: 11 May 2009
Location: United Kingdom
Posts: 6
Posted: 12 May 2009 at 5:32am  

No problem Anton. All I was saying is that the solution above worked for me in part. I have found some info elsewhere on the forum that resolved my problem - all I had to do was exclude a directory from the rewrite rule.

Thanks anyway.
Back to Top
 
shaileshag2002
Newbie


Joined: 13 July 2009
Location: India
Posts: 9
Posted: 28 July 2009 at 3:02am  

Hi

Could you tell me how it solved your problem?

Even i have the same problem and want to get it done only by using some rule.

Thanks,
Shailesh


__________________
Thanks,
Shailesh
Back to Top
 
Anton
Admin Group


Joined: 30 January 2007
Location: Ukraine
Posts: 10519
Posted: 28 July 2009 at 6:16am  

To shaileshag2002:

Could you please create a new post for your question and desribe it in more details.

__________________
Regards,
Anton
Back to Top
 

Sorry, you can NOT post a reply.
This forum has been locked by a forum administrator.

Printable version Printable version
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum