I'm new to this, please have grace...

So I understand changing the .htaccess file to let users type in a new link, and then it reference the old page as seen here:
I want to access, by typing in

.htaccess file:
Options +FollowSymLinks
RewriteEngine On

RewriteRule ^(.*)_(.*)_(.*)\.html$ result.php?var1=$1&var2=$2&var3=$3

it works... but now, how do I automatically when I submit the form, get the new link to display? Or in other words, how do when we type in be redirected to

Any help would be appreciated!

6 Years
Discussion Span
Last Post by santclasi

You have to send the 301 redirect code explicitly as a flag
These flags go in brackets after your RewriteRule. In your case you could try this:

RewriteRule ^(.*)_(.*)_(.*)\.html$ result.php?var1=$1&var2=$2&var3=$3 [R=301, L]

R=301 says "send the 301 permanent redirect"
the L flag says that this is the last flag for this command.

Here is a random googled page for RewriteRule flags:

Good luck!

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.