Possible to rewrite old url's ?
Hi,
After converting from phpbb to vanilla the links users posted on phpbb to other topics no longer work because the url has changed. Is it possible to fix this with a rewrite rule ? (I'm on Apache). URL's look like this:
OLD: http://www.audi-a2.nl/cc-hendel-plaatsen-voor-een-1-2tdi-3l-t3174.html
NEW: http://www.audi-a2.nl/discussion/3174/cc-hendel-plaatsen-voor-een-1-2tdi-3l
Thanks for your input !
0
Comments
You may want to use
[R=301]instead of[L]Thanks @x00 that was beyond my grep knowledge. Both links now lead to the correct page. Thanks.
Why is that @x00 ? When I make that change I get a "page not found"
It's probably clashing with other rewrite rules. Try both: [R=301,L]
This is my .htaccess. I'm not to familiar with Apache. When I add the suggested R=301 I get a page not found.
`# Modified
RewriteEngine On
# Certain hosts may require the following line.
# If vanilla is in a subfolder then you need to specify it after the /.
# (ex. You put Vanilla in /forum so change the next line to: RewriteBase /forum)
# RewriteBase /
RewriteRule ^(.*?)-t([0-9]+).html$ discussion/$2/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php\?p=$1 [QSA,L]
`
RewriteRule ^(.*?)-t([0-9]+).html$ %{REQUEST_SCHEME}://%{HTTP_HOST}/discussion/$2/$1 [L, R=301]also, you may have another issue. What folder is your forum in? by removing the # on RewriteBase line
if so read this
and change accordingly. e.g.
if in root folder
RewriteBase /
if in vanilla
RewriteBase /vanilla
if forum is located in /Sometherfolder
RewriteBase /Sometherfolder
My forum is root @peregrine hence the # ;-)