iEntry 10th Anniversary Forum Rules Search
WebProWorld
Register FAQ Calendar Mark Forums Read
Web Programming Discussion Forum Working with an API? Developing a plugin? Writing a Mod or script for your favorite blog, Web 2.0 site or Forum? Welcome.

Share Thread: & Tags

Share Thread:

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-02-2007, 03:16 PM
WebProWorld Member
 
Join Date: Oct 2003
Location: Cannes, France
Posts: 37
LoveNotWar RepRank 0
Default Redirecting database generated pages from within .htaccess

Hello ... I have a bit of a problem one of you gurus may be able to help me with. I have changed the technology on our site a bit, and really need to be able to REDIRECT certain pages to the new pages from within .HTACCESS using a permanent redirect...

I have been trying on the following format (real example) and they dont work ...

redirect permanent /index.php?pid=1&user=det http://rentals.azur-online.com/prope...tail.php?pid=1

I imagine that this is because the first URL is a dynamic one ... database generated.

Is there any way to do this? Please help! Thanks!

Lao
__________________
Fear is a habit. I am not afraid!

http://www.azur-online.com

and by the way ... STOP killing Zimbabwe! http://www.team-zimbabwe.net
Reply With Quote
  #2 (permalink)  
Old 01-02-2007, 04:53 PM
wige's Avatar
Moderator
WebProWorld Moderator
 
Join Date: Jun 2006
Location: United States
Posts: 2,648
wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9
Default

I take it from your example and by testing it that the problem you are encountering is that the user is not redirected at all. Do you have any redirect commands in your .htaccess file that are working? If you have a shared host, you may not be able to set .htaccess commands on your server.

I have used redirects with dynamic content and have not run into problems under Apache, and your syntax looks to be correct to me.

If you are able to use .htaccess commands and have other redirects that work, check the error log for your server to see if the software is encountering an error when trying to run the redirection command.
__________________
The best way to learn anything, is to question everything.
Reply With Quote
  #3 (permalink)  
Old 01-03-2007, 04:07 AM
WebProWorld Member
 
Join Date: Oct 2003
Location: Cannes, France
Posts: 37
LoveNotWar RepRank 0
Default

Hello Mike, thanks for your input.

In answer, yes, I have other redirects within the same .htaccess which ARE working.

EXAMPLE:

redirect permanent /html_pages/pid1.html http://rentals.azur-online.com/prope...tail.php?pid=1

That one works fine ... which is why I thought that perhaps the one that is NOT working was due to .htaccess being unable to redirect a dynamic URL!

Thanks for hte info that it SHOULD work in theory. I will try get error logs from my Sysadmin and see if there is any light he can shed

Any other thoughts from anyone would still be really appreciated, though, because as yet problem is still unresolved!

Lao
__________________
Fear is a habit. I am not afraid!

http://www.azur-online.com

and by the way ... STOP killing Zimbabwe! http://www.team-zimbabwe.net
Reply With Quote
  #4 (permalink)  
Old 01-03-2007, 04:47 PM
wige's Avatar
Moderator
WebProWorld Moderator
 
Join Date: Jun 2006
Location: United States
Posts: 2,648
wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9
Default

It is possible you may need to add a backslash in front of the ? so it reads as /index.php\?pid=1

Worst case scenario you can use the following code:

RedirectMatch 301 /index.php?(.*)&iser=det http://rentals.azur-online.com/property_detail.php?$1
__________________
The best way to learn anything, is to question everything.
Reply With Quote
  #5 (permalink)  
Old 01-04-2007, 02:01 AM
WebProWorld Member
 
Join Date: Oct 2003
Location: Cannes, France
Posts: 37
LoveNotWar RepRank 0
Default

I have tried both those options and still no joy, FYI. Waiting on my server admin coming back to me with error logs, so will wait and see what they turn up. I will let you know, again just FYI and if this is of use to anyone else if and when I have any joy!

Lao
__________________
Fear is a habit. I am not afraid!

http://www.azur-online.com

and by the way ... STOP killing Zimbabwe! http://www.team-zimbabwe.net
Reply With Quote
Reply

  WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum

Thread Tools
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 On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 05:05 AM.



Search Engine Optimization by vBSEO 3.3.0