homepage Welcome to WebmasterWorld Guest from 54.166.122.86
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
Rewriting into "different" folder
Known problem?
ukgimp

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 2116 posted 10:30 am on Nov 20, 2003 (gmt 0)

Battling with a rewrite and it occurred to me that there might be a problem when it comes to having things appear in different folders. Here the scenario.

url/detail-6.php works when detail.php?id=$c

but when I try and “change” the folder a la

url/detail/6.php

it wont stand for it. In that it wont find anything.

I hope the above makes sense, after reading it, it seems mighty confusing.

Cheers

 

rpking

10+ Year Member



 
Msg#: 2116 posted 10:43 am on Nov 20, 2003 (gmt 0)

Are you using 404s with PHP or mod rewrite?

Either way should work, you just need to get your syntax right. Can you post some of your code?

ukgimp

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 2116 posted 10:52 am on Nov 20, 2003 (gmt 0)

I have tried to de-specific it, so I am hopng that I have not created and error in that stage

rewriteRule folder\/detail-([0-9]+)\.php http:\/\/localhost\/folder\/detail.php?c=$1 [L]

works but

rewriteRule folder\/detail/([0-9]+)\.php http:\/\/localhost\/folder\/detail.php?c=$1 [L]

in the php the two respective urls are

detail-$var.php

and

detail/$var.php

The folders in the location are fine.

I am struggling as to why this wont work, but I must be missing something. It is not critical, just not the exact way I would like it.

Cheers

rpking

10+ Year Member



 
Msg#: 2116 posted 10:57 am on Nov 20, 2003 (gmt 0)

Your second rule has an unescaped / after detail... is that the problem?

ukgimp

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 2116 posted 11:01 am on Nov 20, 2003 (gmt 0)

rpking

I thank you. Regex, what fun lol

rpking

10+ Year Member



 
Msg#: 2116 posted 11:02 am on Nov 20, 2003 (gmt 0)

A nightmare if broken but when it works... beautiful!

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved