Notices
Computer & Technology Related Post here for help and discussion of computing and related technology. Internet, TVs, phones, consoles, computers, tablets and any other gadgets.

bloody regular expressions

Thread Tools
 
Search this Thread
 
Old Aug 26, 2008 | 03:35 PM
  #1  
stevem2k's Avatar
stevem2k
Thread Starter
Scooby Regular
 
Joined: Sep 2001
Posts: 4,670
Likes: 0
From: Kingston ( Surrey, not Jamaica )
Default bloody regular expressions

I want to strip the www. from a domain , then redirect on context to https:// if applicable...

Having beaten myself with this for too long, a fresh pair of eyes is required...


RewriteCond %{HTTP_HOST} ^www\.foo\.bar\.com$ [NC]
RewriteRule ^(.*)$ http://foo.bar.com/$1 [R=301]

RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^/(place/.*)$ https://%{HTTP_HOST}$1 [R=301,L]



WTF is wrong ...

Steve
Reply
Old Aug 26, 2008 | 03:42 PM
  #2  
Andy Tang's Avatar
Andy Tang
Scooby Regular
iTrader: (3)
 
Joined: Dec 1999
Posts: 13,274
Likes: 0
From: UK
Default

Sorry chap, wish I could help but I'm rubbish with RegEx.

I use this when I need a hand: Regular-Expressions.info - Regex Tutorial, Examples and Reference - Regexp Patterns
Reply
Old Aug 26, 2008 | 04:10 PM
  #3  
RichB's Avatar
RichB
Scooby Regular
 
Joined: Apr 1999
Posts: 3,666
Likes: 0
From: Bore Knee Muff
Default

Welcome to hell!
Reply
Related Topics
Thread
Thread Starter
Forum
Replies
Last Post
Wingnuttzz
Member's Gallery
30
Apr 26, 2022 11:15 PM
KAS35RSTI
Subaru
27
Nov 4, 2021 07:12 PM
powerwrx
Non Scooby Related
21
Oct 3, 2015 11:31 PM
mart360
Non Scooby Related
9
Sep 29, 2015 01:45 PM
JonMc
Lighting and Other Electrical
12
Sep 25, 2015 11:34 AM




All times are GMT +1. The time now is 01:26 AM.