Welcome to HostingForumz.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

rewrite conditions in .htaccess

 
   Web Hosting Problem Solving Community! (Home) -> Apache RSS
Next:  apache2 and mysql authentication  
Author Message
user2710

External


Since: Mar 11, 2004
Posts: 27



(Msg. 1) Posted: Fri Sep 17, 2004 6:15 pm
Post subject: rewrite conditions in .htaccess
Archived from groups: alt>apache>configuration (more info?)

Hi there,

I am wondering how to write a condition which is true for http and https
I tryed to replace the s with *, but this did not work as expected.

Have a look:
RewriteCond %{HTTP_REFERER} !^http*://www.servername.*$ [NC]

Is there a special joker character available then *`?

Thank you for any hint,

Merlin

 >> Stay informed about: rewrite conditions in .htaccess 
Back to top
Login to vote
alvaro_quitar_1

External


Since: Oct 31, 2003
Posts: 86



(Msg. 2) Posted: Fri Sep 17, 2004 7:04 pm
Post subject: Re: rewrite conditions in .htaccess [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

*** Merlin wrote/escribió (Fri, 17 Sep 2004 15:15:45 +0200):
 > RewriteCond %{HTTP_REFERER} !^http*://www.servername.*$ [NC]

This matches, if I'm not wrong, <a style='text-decoration: underline;' href="htt://" target="_blank">htt://</a> and <a style='text-decoration: underline;' href="http://" target="_blank">http://</a>

Try ^http[s]{0,1}://


--
-- Álvaro G. Vicario - Burgos, Spain
-- Thank you for not e-mailing me your questions
--<!-- ~MESSAGE_AFTER~ -->

 >> Stay informed about: rewrite conditions in .htaccess 
Back to top
Login to vote
user2710

External


Since: Mar 11, 2004
Posts: 27



(Msg. 3) Posted: Sat Sep 18, 2004 1:44 pm
Post subject: Re: rewrite conditions in .htaccess [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

thank you I will try that

Alvaro G Vicario wrote:
 > *** Merlin wrote/escribió (Fri, 17 Sep 2004 15:15:45 +0200):
 >
  >>RewriteCond %{HTTP_REFERER} !^http*://www.servername.*$ [NC]
 >
 >
 > This matches, if I'm not wrong, <a style='text-decoration: underline;' href="htt://" target="_blank">htt://</a> and <a style='text-decoration: underline;' href="http://" target="_blank">http://</a>
 >
 > Try ^http[s]{0,1}://
 >
 ><!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: rewrite conditions in .htaccess 
Back to top
Login to vote
spam3

External


Since: Jul 01, 2003
Posts: 411



(Msg. 4) Posted: Mon Sep 20, 2004 4:23 pm
Post subject: Re: rewrite conditions in .htaccess [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Alvaro G Vicario wrote:

 > *** Merlin wrote/escribió (Fri, 17 Sep 2004 15:15:45 +0200):
 >
  >>RewriteCond %{HTTP_REFERER} !^http*://www.servername.*$ [NC]
 >
 >
 > This matches, if I'm not wrong, <a style='text-decoration: underline;' href="htt://" target="_blank">htt://</a> and <a style='text-decoration: underline;' href="http://" target="_blank">http://</a>

as well as <a style='text-decoration: underline;' href="httpppppppppppppppppppppppp://" target="_blank">httpppppppppppppppppppppppp://</a> Wink

 > Try ^http[s]{0,1}://

or

^https?

--
Justin Koivisto - spam.RemoveThis@koivi.com
<a style='text-decoration: underline;' href="http://www.koivi.com" target="_blank">http://www.koivi.com</a><!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: rewrite conditions in .htaccess 
Back to top
Login to vote
kalvaronospamt

External


Since: Feb 25, 2004
Posts: 58



(Msg. 5) Posted: Mon Sep 20, 2004 11:20 pm
Post subject: Re: rewrite conditions in .htaccess [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

*** Justin Koivisto escribió/wrote (Mon, 20 Sep 2004 13:23:06 GMT):
 > ^https?

What's the meaning of the '?' symbol here?

I've never been to find a description of the exact regex dialect Apache
speaks...


--
-+ Álvaro G. Vicario - Burgos, Spain
+- <a style='text-decoration: underline;' href="http://www.demogracia.com" target="_blank">http://www.demogracia.com</a> (la web de humor barnizada para la intemperie)
++ Las dudas informáticas recibidas por correo irán directas a la papelera
-+ I'm not a free help desk, please don't e-mail me your questions
--<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: rewrite conditions in .htaccess 
Back to top
Login to vote
spam3

External


Since: Jul 01, 2003
Posts: 411



(Msg. 6) Posted: Mon Sep 20, 2004 11:20 pm
Post subject: Re: rewrite conditions in .htaccess [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Alvaro G. Vicario wrote:

 > *** Justin Koivisto escribió/wrote (Mon, 20 Sep 2004 13:23:06 GMT):
 >
  >>^https?
 >
 >
 > What's the meaning of the '?' symbol here?
 >
 > I've never been to find a description of the exact regex dialect Apache
 > speaks...
 >
 >

s? == s{0,1}

Here's a page with some stuff about regex for reference... It's a
reference for perl regex, so some of the info here may not apply to
apache, but much the basics do...

<a style='text-decoration: underline;' href="http://www.wellho.net/regex/perlre.html" target="_blank">http://www.wellho.net/regex/perlre.html</a>

--
Justin Koivisto - spam DeleteThis @koivi.com
<a style='text-decoration: underline;' href="http://www.koivi.com" target="_blank">http://www.koivi.com</a><!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: rewrite conditions in .htaccess 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
.htaccess rewrite - Hello. I'm trying to redirect all requests from http://domain1.com/* to http://domain2.com/* I have the following in my .htaccess file in the doc root of domain1.com: RewriteEngine on RewriteCond %{REQUEST_URI} !-U RewriteRule ^(.+) ..

Rewrite with .htaccess, php on linux - I am trying to achieve this solution of having pages served statically by the web server. The URL rewriting is occuring, but I can't get the server to output the file as an .html page. Is there something similar in .php to force the output of the query t...

Beautify URL with apache rewrite or <file> in .htaccess - Hi I searched the web nearly the whole day and found some solutions which may solve me needs. i like to hide my dynmaic url index.php?a=1&b=2 wirth anything else which ends with .html but let me pass information in the url. First i tried : <File...

Redirect (based on multiple conditions) - ---I would like to make a redirect (to browser) like this:--- RewriteCond %{http_REFERER} whatever\.com [NC,OR] RewriteCond %{http_REFERER} (.*)(dumWord1|dumWord2|dumWord3|)(.*) [NC] ---Combined(i.e. AND) with a negated (i.e. NOT)--- RewriteCond..

REWRITE - I have a movie download site and what i need is that if users are linking my files (like http://www.eengoedidee.nl/videoz/bmx/jib.mpg) that they come to a page for the download. Like this..
   Web Hosting Problem Solving Community! (Home) -> Apache All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

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



[ Contact us | Terms of Service/Privacy Policy ]