This forum has been moved here:
Helicon Tech Community Forum

ISAPI_Rewrite 3.0 (Forum Locked Forum Locked)
 Helicon Tech : ISAPI_Rewrite 3.0
Subject Topic: Simple Rewrite - Please help!
Author
Message |
cdsouza
Newbie


Joined: 12 May 2011
Location: United States
Posts: 7
Posted: 12 May 2011 at 8:44pm

So i have:
RewriteRule ^index.aspx$ / [R=301,L]

To force the domain to remove index.aspx.

But for all other folders and subfolders i want to add index.aspx.

Example: I want www.abc.com/folder/ to be www.abc.com/folder/index.aspx


Back to Top
 
cdsouza
Newbie


Joined: 12 May 2011
Location: United States
Posts: 7
Posted: 13 May 2011 at 3:47pm

nobody huh?
Back to Top
 
Guests
Guest


Joined: 01 October 2003
Online Status: Online
Posts: -160
Posted: 16 May 2011 at 8:02am

The rule you've provided is ISAPI_Rewrite 3 syntax, but your question is in ISAPI_Rewrite 2 forum.
Please clarify your version.

Regards
Andrew
Back to Top
 
cdsouza
Newbie


Joined: 12 May 2011
Location: United States
Posts: 7
Posted: 16 May 2011 at 11:06am

I want any folder except root to always have index.aspx.

For example, if someone enters www.abc.com/subfolder/

I want it to go to www.abc.com/subfolder/index.aspx

Same with www.abc.com/subfolder/subfolder2/
I want it go to to Same with www.abc.com/subfolder/subfolder2/index.aspx
Back to Top
 
Guests
Guest


Joined: 01 October 2003
Online Status: Online
Posts: -160
Posted: 17 May 2011 at 5:34am

Syntax for v2 is different from 3. Please, clarify your version, so I could provide you with the suitable rule.

Regards
Andrew
Back to Top
 
cdsouza
Newbie


Joined: 12 May 2011
Location: United States
Posts: 7
Posted: 17 May 2011 at 12:50pm

V3. Thank you, much appreciated. 
Back to Top
 
Guests
Guest


Joined: 01 October 2003
Online Status: Online
Posts: -160
Posted: 18 May 2011 at 4:55am

Hello,

Please, try using:

Code:
RewriteEngine on
#RewriteBase /

RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(.*)$ /$1/index.aspx [NC,R=301,L]


Regards
Andrew
Back to Top
 
cdsouza
Newbie


Joined: 12 May 2011
Location: United States
Posts: 7
Posted: 18 May 2011 at 6:14pm

Thanks Andrew, I will give it a try.

And this won't affect my other rule,

RewriteRule ^index.aspx$ / [R=301,L]

??
Back to Top
 
cdsouza
Newbie


Joined: 12 May 2011
Location: United States
Posts: 7
Posted: 18 May 2011 at 6:53pm

So that was close but two issues.

One, I don't want to have this rule apply to root.

I want www.abc.com to remain as such.

The other issue is that www.abc.com/page translates fine, but www.abc.com/page/ translates to www.abc.com/page//index.aspx

An extra forward slash.
Back to Top
 
Guests
Guest


Joined: 01 October 2003
Online Status: Online
Posts: -160
Posted: 19 May 2011 at 6:26am

Than make it this way:

RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^/(.+)$ /$1/index.aspx [NC,R=301,L]
Back to Top
 
cdsouza
Newbie


Joined: 12 May 2011
Location: United States
Posts: 7
Posted: 19 May 2011 at 12:51pm

Okay. I used above but it does not seem to do anything at all?
Back to Top
 
Guests
Guest


Joined: 01 October 2003
Online Status: Online
Posts: -160
Posted: 25 May 2011 at 3:25am

Please, provide the rewrite.log for the testing request.
Logging issues described in FAQ


Regards
Andrew
Back to Top
 

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

Printable version Printable version