How to redirect

This is a discussion on How to redirect within the Apache Web Server forums, part of the Web Server and Related Forums category; I'm transferring my site from static pages which are all called www.mysite.com/[productcode].html, to a PHP ...


Go Back   Usenet Forums > Web Server and Related Forums > Apache Web Server

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 06-04-2004
Andy Rigby
 
Posts: n/a
Default How to redirect

I'm transferring my site from static pages which are all called
www.mysite.com/[productcode].html, to a PHP solution that will have one standard
product page (product.php) and will take the product code to display
as a parameter eg www.mysite.com\product.php?id=12345

I'd like to make sure that all search engine links and other links
that currently go straight to an HTML product page will still be able
to find the correct page, so I thought I'd see if it can be done with
a .htaccess redirect.

eg

redirect *.html *.php?id=????? (syntax obviously not perfect!)

I'm hopeless at the expression parsing bit of htaccess and wondered if
anyone has done a similar thing before. I will need to be able to
exclude certain files (eg index.html) from the redirects, although I
could even get round this if it's not possible.
  #2 (permalink)  
Old 06-04-2004
Davide Bianchi
 
Posts: n/a
Default Re: How to redirect

Andy Rigby <ecol1111@yahoo.co.uk> wrote:
> to find the correct page, so I thought I'd see if it can be done with
> a .htaccess redirect.


I think you'll need some rewrite rule in order to do so.
See the documentation for mod_rewrite.

Davide

--
| Well, if you can't believe what you read in a comic book, what can
| you believe?!
|
|
  #3 (permalink)  
Old 06-07-2004
Andy Rigby
 
Posts: n/a
Default Re: How to redirect

It's the HTACCESS file I really need to find out about. I'm familiar
with editing it, as I've used it before, but I find it really hard to
get my head around the expression parsing syntax when it comes to only
redirecting certain page requests.

Andy

ecol1111@yahoo.co.uk (Andy Rigby) wrote in message news:<d7d8dd25.0406040623.7a2e1bf7@posting.google. com>...
> I'm transferring my site from static pages which are all called
> www.mysite.com/[productcode].html, to a PHP solution that will have one standard
> product page (product.php) and will take the product code to display
> as a parameter eg www.mysite.com\product.php?id=12345
>
> I'd like to make sure that all search engine links and other links
> that currently go straight to an HTML product page will still be able
> to find the correct page, so I thought I'd see if it can be done with
> a .htaccess redirect.
>
> eg
>
> redirect *.html *.php?id=????? (syntax obviously not perfect!)
>
> I'm hopeless at the expression parsing bit of htaccess and wondered if
> anyone has done a similar thing before. I will need to be able to
> exclude certain files (eg index.html) from the redirects, although I
> could even get round this if it's not possible.

  #4 (permalink)  
Old 06-08-2004
Andy Rigby
 
Posts: n/a
Default Re: How to redirect

ecol1111@yahoo.co.uk (Andy Rigby) wrote in message news:<d7d8dd25.0406070053.432aae78@posting.google. com>...
> It's the HTACCESS file I really need to find out about. I'm familiar
> with editing it, as I've used it before, but I find it really hard to
> get my head around the expression parsing syntax when it comes to only
> redirecting certain page requests.
>
> Andy
>

Oh sorry, now I see what you mean....use RewriteRule in my htaccess
file.

OK so I've tried that and got a bit further. I can now redirect to the
'master' page and supply a parameter to it.

The last thing I've got to figure out is how to NOT do the redirect
for certain pages (eg index.html)

Andy
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 10:43 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0