Current location: Hot Scripts Forums » Other Discussions » Web Servers » Rewrite problem


Rewrite problem

Reply
  #1 (permalink)  
Old 06-23-11, 08:30 AM
afox afox is offline
New Member
 
Join Date: Jun 2011
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Rewrite problem

Hi,

I have the following rewrite rules active at the moment.

It converts mydomain.com.au/moreinfo.php?topic=cats

into

mydomain.com.au/topic/cats

Likewise, it does the same with help.php?topic=cats

The problem is, any links within HTML files within the /topic directory, get re-written as well.

So, if I'm looking at /topic/cats, a link like:

www.mydomain.com/intro.php

in the HMTL document gets re-written to www.mydomain.com.au/topic/cats/intro.php

Interestingly, the links actually goes to www.mydomain.com.au/intro.php without a problem.

While it all works fine, I'd really like to clean up the re-write rule so this isn't a problem.

Rewrite code is below... any ideas on how to fix it? I've tried everything I know.

Code:
Options All -Indexes
ErrorDocument 404 /not_found.php

RewriteEngine on
RewriteCond %{HTTP_HOST} ^mydomain.com.au$
RewriteRule ^(.*)$ "http\:\/\/www\.mydomain\.com\.au\/$1" [R=301]

RewriteRule ^topic/([^/\.]+)/?$ moreinfo.php?topic=$1
RewriteRule ^help/([^/\.]+)/?$ help.php?topic=$1

RewriteBase /
RewriteRule ^topic/[^/\.]+(/.*)$ $1 [R=301]
RewriteRule ^topic(/.*)$ $1 [R=301]

RewriteBase /
RewriteRule ^help/[^/\.]+(/.*)$ $1 [R=301]
RewriteRule ^help(/.*)$ $1 [R=301]

Last edited by UnrealEd; 06-23-11 at 10:51 AM.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Url Rewrite Problem Please Help!!! thebolly PHP 2 10-11-09 11:34 AM
login, roles problem dbrook007 ASP.NET 10 11-10-06 03:42 PM
Mod Rewrite problem sod_atticus PHP 1 07-19-06 02:13 PM
mod rewrite problem gnznroses Perl 4 11-02-05 11:24 PM
Asp and Microsoft Access 2002 problem gop373 ASP 2 10-06-04 09:13 AM


All times are GMT -5. The time now is 01:31 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.