Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
mod rewrite, dynamic url not accessable
Old 11-05-2004, 03:49 PM mod rewrite, dynamic url not accessable
Experienced Talker

Posts: 45
Trades: 0
From tutorials on Apache's mod rewrite I see they give examples like this:

RewriteRule ^htax/star/(.*)/(.*).php /htax/star.php?req=tutorial&tut_id=$1&page=$2


And when I try it it does successfully get to the /htax/star.php page, but I encounter 3 problems not mentioned in said tutorials.

1. No $_GET variables are set, no query string is present, this part : "?req=tutorial&tut_id=$1&page=$2" is basically useless.

2. The browser can't find images, css files, etc. since the path is now in a fake directory.

3.further links and such will have the problem mentioned above.

I know I can work around these problems by changing paths and breaking apart urls but I'm wondering if there is another commonly used solution? Possibly my Apache settings should be changed? Using apache on windows, tried Options +followsymlinks
__________________
-sites/domains i have-
Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE
-
accesstimes is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 11-05-2004, 09:59 PM
KeithMcL's Avatar
Super Talker

Posts: 128
Location: Dublin, Ireland
Trades: 0
Try changing your rule to:
Code:
RewriteRule ^htax/star/(.*)/(.*)\.php$ /htax/star.php?req=tutorial&tut_id=$1&page=$2
Notice the \ before the .php and the $ after it.

Also, to fix the image & link paths you can try adding the base tag to the top of your page:
HTML Code:
<base href="http://www.site.com/path/to/folder">
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
KeithMcL is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to mod rewrite, dynamic url not accessable
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.10511 seconds with 12 queries