This forum has been moved here:
Helicon Tech Community Forum

Helicon Ape (Forum Locked Forum Locked)
 Helicon Tech : Helicon Ape
Subject Topic: rewrite everything except folder
Author
Message |
Dave-W
Groupie


Joined: 09 December 2009
Location: United Kingdom
Posts: 43
Posted: 18 October 2010 at 5:30am

I have this and it works fine but when I go to the admin folder it also rewrites everything in that folder as well. Is there a way to stop a folder being included in the rewrite.

RewriteEngine on
RewriteBase /
RewriteRule ^(.+)\.aspx$ $1.htm [NC,L,R=301,NS]

RewriteCond %{REQUEST_FILENAME} ^(.+)\.htm$ [NC,NS]
RewriteCond %1.aspx -f
RewriteRule ^(.+)\.htm$ $1.aspx [NC,L,NS]
Back to Top
 
Anton
Admin Group


Joined: 30 January 2007
Location: Ukraine
Posts: 10519
Posted: 18 October 2010 at 5:48am

Yes, sure it's possible.
Please try to use the following:

RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_URI} !^/admin [NC]
RewriteRule ^(.+)\.aspx$ $1.htm [NC,L,R=301,NS]

RewriteCond %{REQUEST_URI} !^/admin [NC]
RewriteCond $1.aspx -f
RewriteRule ^(.+)\.htm$ $1.aspx [NC,L,NS]

__________________
Regards,
Anton
Back to Top
 
Dave-W
Groupie


Joined: 09 December 2009
Location: United Kingdom
Posts: 43
Posted: 18 October 2010 at 5:56am

thanks, that works a treat.

Back to Top
 
berekenauto
Newbie


Joined: 14 April 2010
Posts: 2
Posted: 26 October 2010 at 8:14am

I have a similar problem.

I have a wordpress site. that i rewrite with the following rules.

Options +Followsymlinks
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php [L]
CheckSpelling On

this works fine.

but in the map "welkomstcadeau" i have an index.php file.

but when i go tho www.domain.com/welkomstcadeau he cannot open the index.php file.

Can someone help me with this rule. if i go to www.domain.com/welkomstcadeau/index.php it starts.

Back to Top Visit berekenauto's Homepage
 
Anton
Admin Group


Joined: 30 January 2007
Location: Ukraine
Posts: 10519
Posted: 28 October 2010 at 1:48am

@berekenauto:

First, please remove the first and the last lines from the config as they are not supported.

Then enable logging in httpd.conf by putting

RewriteLogLevel 9

and provide rewrite log records for the request in question.

__________________
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