Isapi 3 Rewrite Multipage 301 Assistance
5 posts
• Page 1 of 1
Isapi 3 Rewrite Multipage 301 Assistance
I am trying to figure out the correct statements needed so I can do multiple page 301 redirect to pages that were originally in generated in an .asp program and are now being generated is .php program. I am on a shared server that has Isapi_Rewrite 3 running on it. The php software is currently using the Isapi_Rewrite 3 software to rewrite the urls it generates, so it seems to be working properly.
I have a .htaccess file in the root directory, but I can not get the pages to redirect as expected. I keep getting a 404 errors instead.
Here is a sample of what I want to do:
Old Link:
http://www.dev.mycompany.com/detail.aspx?ID=1812
New Link:
http://www.dev.mycompany.com/noland-eng ... ander.html
There will be multiple page redirects in basically the same type as the two above.
I've tried variations on the following:
RewriteEngine on
RewriteCond Host: dev\.mycompany\.com
RewriteRule ^SearchResult\.aspx\?CategoryID\=449$ /electronics/nmea-devices/nmea-0183-en-2/multiplexers-0183/ [NC,R=301,L]
,but with no success.
Any help with this would be appreciated.
I have a .htaccess file in the root directory, but I can not get the pages to redirect as expected. I keep getting a 404 errors instead.
Here is a sample of what I want to do:
Old Link:
http://www.dev.mycompany.com/detail.aspx?ID=1812
New Link:
http://www.dev.mycompany.com/noland-eng ... ander.html
There will be multiple page redirects in basically the same type as the two above.
I've tried variations on the following:
RewriteEngine on
RewriteCond Host: dev\.mycompany\.com
RewriteRule ^SearchResult\.aspx\?CategoryID\=449$ /electronics/nmea-devices/nmea-0183-en-2/multiplexers-0183/ [NC,R=301,L]
,but with no success.
Any help with this would be appreciated.
Re: Isapi 3 Rewrite Multipage 301 Assistance
Hello,
The rule should be as follows:
RewriteBase /
RewriteCond %{HTTP_HOST} ^dev\.mycompany\.com$ [NC]
RewriteCond %{QUERY_STRING} ^CategoryID=449$ [NC]
RewriteRule ^SearchResult\.aspx$ /electronics/nmea-devices/nmea-0183-en-2/multiplexers-0183/? [NC,R=301,L]
The rule should be as follows:
RewriteBase /
RewriteCond %{HTTP_HOST} ^dev\.mycompany\.com$ [NC]
RewriteCond %{QUERY_STRING} ^CategoryID=449$ [NC]
RewriteRule ^SearchResult\.aspx$ /electronics/nmea-devices/nmea-0183-en-2/multiplexers-0183/? [NC,R=301,L]
Re: Isapi 3 Rewrite Multipage 301 Assistance
Thank you for your quick answer Anton!
I uploaded the code to the server, but I just get a 404 error. So I guess I need to look further. Maybe something else on the server is not correct.
I uploaded the code to the server, but I just get a 404 error. So I guess I need to look further. Maybe something else on the server is not correct.
Re: Isapi 3 Rewrite Multipage 301 Assistance
This is what is currently in .htaccess file: (does the order of the statements make a difference?)
**************
DirectoryIndex index.html index.php
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /
RewriteCond %{HTTP_HOST} ^dev\.mysite\.com$ [NC]
RewriteCond %{QUERY_STRING} ^CategoryID=449$ [NC]
RewriteRule ^SearchResult\.aspx$ /electronics/nmea-devices/nmea-0183-en-2/multiplexers-0183/? [NC,R=301,L]
# Please note that RewriteBase setting is obsolete use it only in case you experience some problems with SEO addon.
# Some hostings require RewriteBase to be uncommented
# Example:
# Your store url is http://www.yourcompany.com/store/cart
# So "RewriteBase" should be:
# RewriteBase /store/cart
# RewriteBase /
RewriteCond %{REQUEST_FILENAME} !\.(png|gif|ico|swf|jpe?g|js|css)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php?sef_rewrite=1 [L,QSA]
</IfModule>
***********
**************
DirectoryIndex index.html index.php
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /
RewriteCond %{HTTP_HOST} ^dev\.mysite\.com$ [NC]
RewriteCond %{QUERY_STRING} ^CategoryID=449$ [NC]
RewriteRule ^SearchResult\.aspx$ /electronics/nmea-devices/nmea-0183-en-2/multiplexers-0183/? [NC,R=301,L]
# Please note that RewriteBase setting is obsolete use it only in case you experience some problems with SEO addon.
# Some hostings require RewriteBase to be uncommented
# Example:
# Your store url is http://www.yourcompany.com/store/cart
# So "RewriteBase" should be:
# RewriteBase /store/cart
# RewriteBase /
RewriteCond %{REQUEST_FILENAME} !\.(png|gif|ico|swf|jpe?g|js|css)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php?sef_rewrite=1 [L,QSA]
</IfModule>
***********
Re: Isapi 3 Rewrite Multipage 301 Assistance
Hello,
"does the order of the statements make a difference?"
- in your case it doesn't
As for the rule we are trying to make working, could you enable logging in httpd.conf by putting
RewriteLogLevel 9
then request the URL in question once again and provide the portion of rewrite.log corresponding to this request.
"does the order of the statements make a difference?"
- in your case it doesn't
As for the rule we are trying to make working, could you enable logging in httpd.conf by putting
RewriteLogLevel 9
then request the URL in question once again and provide the portion of rewrite.log corresponding to this request.
5 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 58 guests