Forum Moderators: phranque
i have urls on my website ,witch accessible with two kind of url
first:
http://www.example.com/p-9.html?osCsid=p9o4u7l7v6m539vvf09j5jrq34
second:
http://www.example.com/p-9.html
how i can make a 301 permanent redirect from first kind to the second?
note:i have too many pages ,witch end with ".html" ,and i dont know the exact name of them ,i just know they end ,by ".html",so i need an formula to redirect all of them
to make a 301 permenent redirect for this type of urls :
http://www.example.com/c-9.html?osCsid=j61lhvng7lvdau2a1enlrku8q0
i add this line :
RedirectMatch 301 (.*)\.html http://www.example.com
but it redirect the pages to none seo urls ,like this :
http://example.com/?cPath=8&osCsid=j61lhvng7lvdau2a1enlrku8q0
and this is my .htaccess witch is suitable for oscmax ,i have install ultimate seo url ,and it will convert ".php" pages to ".html".
/////////////////////////
# The following makes adjustments to the SSL protocol for Internet
# Explorer browsers
<IfModule mod_setenvif.c>
<IfDefine SSL>
SetEnvIf User-Agent ".*MSIE.*" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0
</IfDefine>
</IfModule>
# Fix certain PHP values
#</IfModule>
<IfModule mod_php5.c>
php_flag register_globals on
php_flag register_long_arrays on
php_value default_charset UTF-8
</IfModule>
# Ultimate SEO URLs BEGIN
Options +FollowSymLinks
RewriteEngine On
RewriteBase //
RewriteRule ^(.*)-p-(.*).html$ product_info.php?products_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-c-(.*).html$ index.php?cPath=$2&%{QUERY_STRING}
RewriteRule ^(.*)-m-(.*).html$ index.php?manufacturers_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-pi-(.*).html$ popup_image.php?pID=$2&%{QUERY_STRING}
RewriteRule ^(.*)-t-(.*).html$ articles.php?tPath=$2&%{QUERY_STRING}
RewriteRule ^(.*)-a-(.*).html$ article_info.php?articles_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-pr-(.*).html$ product_reviews.php?products_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-pri-(.*).html$ product_reviews_info.php?products_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-i-(.*).html$ information.php?info_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-links-(.*).html$ links.php?lPath=$2&%{QUERY_STRING}
# Added polls and newsdesk
#RewriteRule ^(.*)-po-([0-9]+).html$ pollbooth.php?pollid=$2&%{QUERY_STRING}
RewriteRule ^(.*)-n-(.*).html$ newsdesk_info.php?newsdesk_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-nc-(.*).html$ newsdesk_index.php?newsPath=$2&%{QUERY_STRING}
RewriteRule ^(.*)-nri-(.*).html$ newsdesk_reviews_info.php?newsdesk_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-nra-(.*).html$ newsdesk_reviews_article.php?newsdesk_id=$2&%{QUERY_STRING}
# Ultimate SEO URLs END
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} ^BlackWidow [OR]
RewriteCond %{HTTP_USER_AGENT} ^Bot\ mailto:craftbot@yahoo.com [OR]
# ... more RewriteConds ...
RewriteCond %{HTTP_USER_AGENT} ^Xaldon\ WebSpider [OR]
RewriteCond %{HTTP_USER_AGENT} ^Zeus
RewriteRule .* - [F]
</ifModule>
/////////////////////////////
[edited by: jdMorgan at 6:32 pm (utc) on Aug. 20, 2008]
[edit reason] Shortened code dump [/edit]