redirect all to default page
2 posts
• Page 1 of 1
redirect all to default page
I'm definitely full blown noob when it comes to editing the htaccess file. Monkey see/Monkey do and I'm fine. ![Wink ;)](./images/smilies/icon_e_wink.gif)
I have a site that where most pages were generated by a dbase, and they were in .php format. Site was hacked and was too much trouble to get the dev/team that the site was assigned to, to patch it up. I've pulled the whole site down, and it is now just a single page site.
Trying to make use of what traffic may still be available.
My goal is to have any and all page requests, simply resolve to the default.aspx home page (with a 301 if possible). I have this partially working after spending the last few hours looking at posts and google searches.
Pages with a straight page name or subfolder/pagename like this are redirecting fine: http://www.rapidrestore.net/fire-smoke-soot/maryland
Pages with a "+" in the url are still landing on a 404:
http://www.rapidrestore.net/flood-water ... storations
Current rule in place:
# Redirect all traffic to one page
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !/default.aspx
RewriteCond %{REQUEST_URI} ^(?!(.*\.(?:gif|jpg|png|css|js)$)).*$
RewriteRule .? /default.aspx [NC,R=301]
Any feedback is greatly appreciated!
Regards,
Mark
![Wink ;)](./images/smilies/icon_e_wink.gif)
I have a site that where most pages were generated by a dbase, and they were in .php format. Site was hacked and was too much trouble to get the dev/team that the site was assigned to, to patch it up. I've pulled the whole site down, and it is now just a single page site.
Trying to make use of what traffic may still be available.
My goal is to have any and all page requests, simply resolve to the default.aspx home page (with a 301 if possible). I have this partially working after spending the last few hours looking at posts and google searches.
Pages with a straight page name or subfolder/pagename like this are redirecting fine: http://www.rapidrestore.net/fire-smoke-soot/maryland
Pages with a "+" in the url are still landing on a 404:
http://www.rapidrestore.net/flood-water ... storations
Current rule in place:
# Redirect all traffic to one page
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !/default.aspx
RewriteCond %{REQUEST_URI} ^(?!(.*\.(?:gif|jpg|png|css|js)$)).*$
RewriteRule .? /default.aspx [NC,R=301]
Any feedback is greatly appreciated!
Regards,
Mark
- HeliconAndrew
-
- Posts: 1264
- Joined: 07 Mar 2012, 10:16
Re: redirect all to default page
Hello,
I think it's rather IIS and Helicon issue. Take a look - http://serverfault.com/questions/76013/ ... t-querystr
Regards
Andrew
I think it's rather IIS and Helicon issue. Take a look - http://serverfault.com/questions/76013/ ... t-querystr
Regards
Andrew
2 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 13 guests