Limit Redirect to certain page types?
3 posts
• Page 1 of 1
Limit Redirect to certain page types?
Hello - I am using the rule from Helicon's examples which routes non-https to https, however I would like to have this only applied to URLs ending in .aspx . Can someone point me in the direction of what needs to be added? Currently the rules I have are:
RewriteEngine on
#Fix missing trailing slash char on folders
RewriteRule ^([^.?]+[^.?/])$ $1/ [R,L]
#Redirect non-HTTPS to HTTPS
RewriteCond %{HTTP:Host} (.*)
RewriteCond %{HTTPS} off
RewriteCond %{REQUEST_URI} (.*)
RewriteRule .? https://%1%2 [R,L]
Thanks in advance!!
RewriteEngine on
#Fix missing trailing slash char on folders
RewriteRule ^([^.?]+[^.?/])$ $1/ [R,L]
#Redirect non-HTTPS to HTTPS
RewriteCond %{HTTP:Host} (.*)
RewriteCond %{HTTPS} off
RewriteCond %{REQUEST_URI} (.*)
RewriteRule .? https://%1%2 [R,L]
Thanks in advance!!
- HeliconAndrew
- Posts: 1264
- Joined: 07 Mar 2012, 10:16
Re: Limit Redirect to certain page types?
hello,
Try using the following:
Regards
Andrew
Try using the following:
- Code: Select all
RewriteEngine on
#Fix missing trailing slash char on folders
RewriteRule ^([^.?]+[^.?/])$ $1/ [R,L]
#Redirect non-HTTPS to HTTPS with .aspx
RewriteCond %{HTTP:Host} (.*)
RewriteCond %{HTTPS} off
RewriteCond %{REQUEST_URI} ([^.]+\.aspx) [NC]
RewriteRule .? https://%1%2 [R,L]
Regards
Andrew
Re: Limit Redirect to certain page types?
This looks like it accomplished exactly what I needed. Thanks!
3 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 16 guests