.htaccess - Problem with 301 redirects due to URL rewriting -


I have got a new site setup using CMSMadeSimple (PHP based) but I am having trouble redirecting 301 old site URL. With new setup

I am using a standard .htaccess file for CMS which translates SEO friendly URL, but I also need to redirect the old URL (ASP site) to this file.

My present. Htaccess is shown below, the line I tried to add

  301 / test.asp redirect http://www.example.com/test. Html  

But when I do this, the page does not redirect as necessary

  # BEGIN Alternate settings # Close the directory browsing # Not absolutely necessary, But keeps # people without empty snapping everywhere need empty index.html files. Option - deny access to index # config.php # This can be useful if PHP ever breaks or dies # Be careful Use it with CMS It can break other functions of MS which can also break a config .php # file it also runs other programs running under your CMSMS # which uses config.php. You may need to add another .htaccess file to those # directories specifically to allow config.php. & Lt; The files "config.php" & gt; Allow orders, from all & lt; / Files & gt; # Your 403 error is not mandatory for document #, or you may already have the explanation of errors pages from earlier errorDocument 403 / forbidden403.shtml # What we are running does not mean that the server services are closed # end optional settings # BEGIN CMSMS and Rewrite Rule # Be sure that you have the option to follow the #SySLinks # and RivetIngine on the subdirectory at #RewriteBase / # URL filtering Hacking attempts to prevent # a "http:" rewrite in the #IIF UI% {QUERY_STRING} http \: [or] # and if "in the URI" ["Rivet condom% {QUERY_STRING} \" [OR] is #OR Or "Rivet condom% {QUERY_STRING} \] [or] #OR in the URI" or if the URI contains "& lt; Script & gt; "RewriteCond% {QUERY_STRING} (\ & amp;; |% 3C). * Script * * (\> |% 3E) [nc, or] # and trying to determine the PHL Global variable via URL Script% {QUERY_STRING} globals (= | \ [| \ [[0- 9A-Z] {0,2}) [or] # or any script% trying to modify a _REQUEST variable via url% {QUERY_STRING} _REQUEST (= | \ [| \% [0- 9A-Z] {0,2}) Rev. * $ - [F, L] #EDI Filtering # CMSM rewriting # set to mod_rewrite config Believe in php and cms Clear the S-Cash Rev $% REQUEST_FILENAME! F Rewy code!% {REQUEST_FILENAME}! -d Rivroitium ^ (. +) $ / Index.fp? Page = $ 1 [QSA] # EDMS CMSMS # Eid Rewrite Rule  

Any help would be greatly appreciated.

rewrite the rule Should be written in a slightly different way:

  rewrite ^ test.asp $ http://www.example.com/test.html [NC, R = 301, L]  

This works for me.


Comments

Popular posts from this blog

sql - dynamically varied number of conditions in the 'where' statement using LINQ -

asp.net mvc - Dynamically Generated Ajax.BeginForm -

Debug on symbian -