This forum has been moved here:
Helicon Tech Community Forum

  Active TopicsActive Topics  Display List of Forum MembersMemberlist  HelpHelp   RegisterRegister  LoginLogin
ISAPI_Rewrite 2.x (Forum Locked Forum Locked)
 Helicon Tech : ISAPI_Rewrite 2.x
Subject Topic: global rewrite to subfolder(s)
Author
Message |
dhtaccess
Newbie


Joined: 01 April 2011
Location: United States
Posts: 5
Posted: 01 April 2011 at 1:31pm

Hi People,

I'm looking to create a rule where dead links pointing to a missing file in a subfolder will redirect to just that subfolder in question thereby hitting either the "default.php" or "index.php" file.

The problem with this particular site is the usage of "index.php" in many subfolders so the other rule for "index.php" sends some of these links to the root domain. This is better than a dead link but not optimal for conversion. Any help would be appreciated.

# Helicon ISAPI_Rewrite configuration file
# Version 3.1.0.78


Back to Top
 
Anton
Admin Group


Joined: 30 January 2007
Location: Ukraine
Posts: 10519
Posted: 04 April 2011 at 2:29am

So, you have ISAPI_Rewrite 3?

Then please try the following lines:

RewtiteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^folder/subfolder/[^.]+\.[^.]+$
folder/subfolder/ [NC.R=301,L]

__________________
Regards,
Anton
Back to Top
 
dhtaccess
Newbie


Joined: 01 April 2011
Location: United States
Posts: 5
Posted: 06 April 2011 at 12:13pm

Thanks for the response Anton. I will give it a try and let you know how I make out.


Back to Top
 
dhtaccess
Newbie


Joined: 01 April 2011
Location: United States
Posts: 5
Posted: 28 April 2011 at 3:13pm

Hi Anton,

Your suggestion worked like a charm but now I have one more (which should be easier but for some reason its not working).

I have several instances where inbound links have sub-directories in them that were either deleted or never existed in the target sites folder structure. e.g. /subdirectory1/subdirectory2/subdirectory3/file.php. Subdirectory3 doesn't exist so I thought the following would fix the problem but it doesn't;

Rewriterule /subdirectory1/subdirectory2/subdirectory3/file.php http://www.domain.com/subdirectory1/subdirectory2/file.php [I,O,RP,L]

Any help would be appreciated. BTW I want this to be a permanent redirect so would the trailing conditions be "[R=301,L]"?


Back to Top
 
Anton
Admin Group


Joined: 30 January 2007
Location: Ukraine
Posts: 10519
Posted: 29 April 2011 at 3:32am

Please try to fix your rule like this:

RewriteRule ^subdirectory1/subdirectory2/subdirectory3/file\.php$ http://www.domain.com/subdirectory1/subdirectory2/file.php [NC,R=301,L]

Yes, the correct syntax for permanent redirect in ISAPI_Rewrite 3 is R=301.

__________________
Regards,
Anton
Back to Top
 

Sorry, you can NOT post a reply.
This forum has been locked by a forum administrator.

Printable version Printable version
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum