RE: [PHP] mod_rewrite q's: syntax?

2006-04-10 Thread Micky Hulse
Well, I added this to the end of my .htaccess:

# Set the index page:
RedirectMatch ^/$ http://mydomain.com/folder/folder/index.php

Seems to work well, but I am still concerned about
pitfalls/optimization/consolidation... er, perfection? ;)

TIA, Cheers,
Micky

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] mod_rewrite q's: syntax?

2006-04-10 Thread Joe Wollard
Mickey,

I'm not an expert on the topic by any stretch of the imagination, but I seem
to recall reading that it's best to move everything into httpd.conf for
performance reasons. You may want to investigate that, but otherwise I don't
see anything wrong with what you're doing.


On 4/10/06, Micky Hulse [EMAIL PROTECTED] wrote:

 Well, I added this to the end of my .htaccess:

 # Set the index page:
 RedirectMatch ^/$ http://mydomain.com/folder/folder/index.php

 Seems to work well, but I am still concerned about
 pitfalls/optimization/consolidation... er, perfection? ;)

 TIA, Cheers,
 Micky

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] mod_rewrite q's: syntax?

2006-04-10 Thread Richard Lynch
On Mon, April 10, 2006 12:50 am, Micky Hulse wrote:
 -Original Message-
 From: Chris [mailto:[EMAIL PROTECTED]
 Do you need to do it with a mod_rewrite?

 if not, you can do it easily in php:

 header('location: folder/file.php');
 exit();

 in index.php.


 Unfortunately, yes... I am using a CMS, and my current setup is
 forcing me
 into using the more complicated mod_rewrite.

 Well, not that it is a bad thing... seems like mod_rewrite is more
 search-engine/bot friendly.

 Thanks for the tip though, I really appreciate your time.

Another alternative, if mod_rewrite confuses you as much as it does me...

.htaccess
Files folder
  ForceType application/x-httpd-php
/Files
DocumentIndex folder

folder
?php
  $pathinfo = $_SERVER['PATH_INFO']; //I always forget if it's
PATHINFO or...
  //do whatever you want with the $pathinfo to include the right code
or return the right content or...
?

On the plus side, this doesn't force people into example.com when they
went to www.example.com -- It just works. :-)

PS

I you do stick with mod_rewrite, turn mod_rewrite_debug *ON* and tail
-f your http error_log for awhile.

You'll learn a lot about what will/won't work for mod_rewrite in your
rules...

The warnings about mod_rewrite debugging/logging performance issues
are a bit over-stated, I think...

Or, at least, you need to do this on a development server with real
traffic patterns for your testing, if doing it live is a non-option.

Doing it on only the URLs *you* think of typing doesn't count.  Those
pesky real users can come up with some really interesting URLs to
type... :-)

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] mod_rewrite q's: syntax?

2006-04-10 Thread Micky Hulse
  -Original Message-
 From: Joe Wollard [mailto:[EMAIL PROTECTED] 
 I'm not an expert on the topic by any stretch of the 
 imagination, but I seem to recall reading that it's best to 
 move everything into httpd.conf for performance reasons. You 
 may want to investigate that, but otherwise I don't see 
 anything wrong with what you're doing.

Sounds good to me, thanks so much for you help. Reading about httpd.conf
now.

Have a great day/week/month/year/...
Cheers,
Micky

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] mod_rewrite q's: syntax?

2006-04-10 Thread Micky Hulse
Hi Richard,

 Doing it on only the URLs *you* think of typing doesn't count.  Those
 pesky real users can come up with some really interesting URLs to
 type... :-)

Lol, I was thinking that might be a problem.

Thanks for all the great tips, I really appreicate your help.

Great info... I am looking forward to learning more about the information
you presented.

Btw, anyone have any good tips for setting-up outlook to format list emails
better? I just got a PC and am coming from the Mac world (Mail app was
pretty simple compared to all the Microsoft bells and whistles)...

Have a good one,
Cheers,
Micky

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] mod_rewrite q's: syntax?

2006-04-10 Thread Richard Lynch
On Mon, April 10, 2006 7:08 pm, Micky Hulse wrote:
 Doing it on only the URLs *you* think of typing doesn't count.
 Those
 pesky real users can come up with some really interesting URLs to
 type... :-)

 Lol, I was thinking that might be a problem.

 Thanks for all the great tips, I really appreicate your help.

 Great info... I am looking forward to learning more about the
 information
 you presented.

 Btw, anyone have any good tips for setting-up outlook to format list
 emails
 better? I just got a PC and am coming from the Mac world (Mail app was
 pretty simple compared to all the Microsoft bells and whistles)...

Abandon Outlook and use Eudora, or Pegasus, or webmail, or ANYTHING
other than Outlook? :-)

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] mod_rewrite q's: syntax?

2006-04-10 Thread Micky Hulse
 -Original Message-
 From: Richard Lynch [mailto:[EMAIL PROTECTED] 
 Abandon Outlook and use Eudora, or Pegasus, or webmail, or ANYTHING
 other than Outlook? :-)

LOL! Yeah, I do not know what I was thinking in the first place... Eudora
sounds good to me.  :D

Cheers,
Micky

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] mod_rewrite q's: syntax?

2006-04-09 Thread Micky Hulse
Hi all... sorry if this is OT for PHP list... Maybe a reply off-list?

I just wanted to share my .htaccess file in the hopes that I can
hone/fool-proof-a-tize it as much as possible via your feedback and
suggestions.

Here is what I got so far...

I start by turning-on error reporting, then I am converting all non www
traffic to www traffic, and I finish things up by removing index.php from
the site url...

[code] --

# Turn-on PHP error messaging:
php_value display_errors 1
php_value error_reporting 2047

# Power-up the rewrite engine:
RewriteEngine on

# Redirect all non-www traffic:
RewriteCond %{HTTP_HOST} ^mydomain\.com$
RewriteRule ^.*$ http://www.mydomain.com%{REQUEST_URI} [R=permanent,L]

# Remove index.php from url:
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.+) index.php/$1 [L]


-- [/code]

What I want to do:

I would like to use mod_rewrite to forward all requests for
http://www.mydomain.com (or http://mydomain.com) to
www.mydomain.com/folder/file.php

Questions:

1. How is my code looking so far? Any potential pitfalls that you can see?
2. Can I combine the conditions and rules into one, more compact, script?
3. Any suggestions on how I would go about adding-in a rule/condition to
redirect users to com/folder/file.php as stated above?

Many TIA,
Sorry if OT.
Cheers,
Micky

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] mod_rewrite q's: syntax?

2006-04-09 Thread Chris

Micky Hulse wrote:

Hi all... sorry if this is OT for PHP list... Maybe a reply off-list?

I just wanted to share my .htaccess file in the hopes that I can
hone/fool-proof-a-tize it as much as possible via your feedback and
suggestions.

Here is what I got so far...

I start by turning-on error reporting, then I am converting all non www
traffic to www traffic, and I finish things up by removing index.php from
the site url...

[code] --

# Turn-on PHP error messaging:
php_value display_errors 1
php_value error_reporting 2047

# Power-up the rewrite engine:
RewriteEngine on

# Redirect all non-www traffic:
RewriteCond %{HTTP_HOST} ^mydomain\.com$
RewriteRule ^.*$ http://www.mydomain.com%{REQUEST_URI} [R=permanent,L]

# Remove index.php from url:
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.+) index.php/$1 [L]


-- [/code]

What I want to do:

I would like to use mod_rewrite to forward all requests for
http://www.mydomain.com (or http://mydomain.com) to
www.mydomain.com/folder/file.php

Questions:

1. How is my code looking so far? Any potential pitfalls that you can see?
2. Can I combine the conditions and rules into one, more compact, script?
3. Any suggestions on how I would go about adding-in a rule/condition to
redirect users to com/folder/file.php as stated above?


Do you need to do it with a mod_rewrite?

if not, you can do it easily in php:

header('location: folder/file.php');
exit();

in index.php.

--
Postgresql  php tutorials
http://www.designmagick.com/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] mod_rewrite q's: syntax?

2006-04-09 Thread Micky Hulse
 -Original Message-
 From: Chris [mailto:[EMAIL PROTECTED] 
 Do you need to do it with a mod_rewrite?
 
 if not, you can do it easily in php:
 
 header('location: folder/file.php');
 exit();
 
 in index.php. 


Unfortunately, yes... I am using a CMS, and my current setup is forcing me
into using the more complicated mod_rewrite.

Well, not that it is a bad thing... seems like mod_rewrite is more
search-engine/bot friendly.

Thanks for the tip though, I really appreciate your time.

Cheers,
Micky

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php