Note that there are some explanatory texts on larger screens.

plurals
  1. POProblem with 301 redirects due to URL rewriting
    primarykey
    data
    text
    <p>I've got a new site setup using CMSMadeSimple (PHP based) but I'm having problems 301 redirecting the old site URLs with the new setup.</p> <p>I'm using a standard .htaccess file for the CMS which translates SEO friendly URLs like <a href="http://www.example.com/test.html" rel="nofollow noreferrer">http://www.example.com/test.html</a> into <a href="http://www.example.com?page=test" rel="nofollow noreferrer">http://www.example.com?page=test</a>, but I also need to redirect old URLs (ASP site) in this file.</p> <p>My current .htaccess is shown below, the line I've tried to add is</p> <pre><code>redirect 301 /test.asp http://www.example.com/test.html </code></pre> <p>but when I do this the page redirects to <a href="http://www.example.com/test.html?page=test.asp" rel="nofollow noreferrer">http://www.example.com/test.html?page=test.asp</a> not <a href="http://www.example.com/test.html" rel="nofollow noreferrer">http://www.example.com/test.html</a> as required</p> <pre><code># BEGIN Optional settings # Turns off directory browsing # not absolutely essential, but keeps people from snooping around without # needing empty index.html files everywhere Options -Indexes # Deny access to config.php # This can be useful if php ever breaks or dies # Use with caution, this may break other functions of CMSms that use a config.php # file. This may also break other programs you have running under your CMSms # install that use config.php. You may need to add another .htaccess file to those # directories to specifically allow config.php. &lt;Files "config.php"&gt; order allow,deny deny from all &lt;/Files&gt; # Sets your 403 error document # not absolutely essential to have, # or you may already have error pages defined elsewhere ErrorDocument 403 /forbidden403.shtml # No sense advertising what we are running ServerSignature Off # END Optional Settings # BEGIN CMSMS and Rewrite Rules # Make sure you have Options FollowSymLinks # and Allow on RewriteEngine On # Might be needed in a subdirectory #RewriteBase / # URL Filtering helps stop some hack attempts #IF the URI contains a "http:" RewriteCond %{QUERY_STRING} http\: [OR] #OR if the URI contains a "[" RewriteCond %{QUERY_STRING} \[ [OR] #OR if the URI contains a "]" RewriteCond %{QUERY_STRING} \] [OR] #OR if the URI contains a "&lt;script&gt;" RewriteCond %{QUERY_STRING} (\&lt;|%3C).*script.*(\&gt;|%3E) [NC,OR] #OR script trying to set a PHP GLOBALS variable via URL RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR] #OR any script trying to modify a _REQUEST variable via URL RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2}) RewriteRule ^.*$ - [F,L] # END Filtering # CMSMS Rewriting # Set assume mod_rewrite to true in config.php and clear CMSMS cache RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.+)$ /index.php?page=$1 [QSA] # END CMSMS # END Rewrite rules </code></pre> <p>Any help would be greatly appreciated.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload