Forum Moderators: phranque
/show.php/act/ST/f/27/t/1165 to read/1165.html
/show.php/act/ST/f/27/t/3387 to read/3387.html
/show.php/act/ST/f/3/t/186 to read/186.html
I got about 5000 pages like this, so one by one is not an option...
thanks,
Ahni
this is what I have so far:
RewriteEngine on
RewriteRule ACT/ST/f/3/t/(.*)$ directory/$1\.html [R=301,L]
what's missing is the "/t/filename" gets changed to "tfilename.html"
could someone give me a hint on what I can do here
(and please scratch my first post, I wrote it wrong)
Thanks
-Ahni
RewriteRule act/ST/f/4/t/(.*)$ [web.site...] [R=301,L]
but I've discovered another question I do need some help with... how to redirect /forum/index.php?s=f65675fa27e8267bfc13d1a515985d5e&showtopic=887
to /read/t887.html
I'm not too sure how to deal with the session? could I just supress it or something?
Thanks
I do not know your exact situation, except for the URL posted, so if this is not exact, it should get you close:
RewriteCond %{QUERY_STRING} s=[^&]&[a-z]+=([0-9]+) [NC]
RewriteRule ^forum/index\.php$ /read/t%1.html [R=301,L]
Rule: if the requested URL is forums/index.php redirect it to /read/tVARIABLE.html if the Condition is met. The %1 is the first (and in this case only) variable from the Condition.
Condition: if the Query String starts with s= followed by anything that is not a &, then has an & followed by one or more letters from a to z, then has an = followed by one or more numbers from 0 to 9 - () create a variable, so we store the numbers in a variable. NC is for No Case, so we match both upper and lower case strings.
Hope this helps.
Justin
I tried what you gave me, but
ghostchild.com/forum/index.php?s=d35ca0e7a5843c501d946045f3074158&showtopic=728
was still 404
So I don't make this more confusing, here's what's in the .htaccess in the /forum/ directory
=====
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{THE_REQUEST} ^[A-Z]+\ /forum/index\.php\?showtopic=([0-9]+)\ HTTP/
rewriterule ^index\.php$ /read/t%1.html [R=301,L]
rewriterule ^t([0-9]+)\.html$ /forum/index.php?showtopic=$1 [L]
RewriteRule show.php/act/ST/f/3/t/(.*)$ /read/t$1\.html [R=301,L]
RewriteRule show.php/act/ST/f/27/t/(.*)$ /read/t$1\.html [R=301,L]
RewriteRule show.php/act/ST/f/28/t/(.*)$ /read/t$1\.html [R=301,L]
RewriteRule show.php/act/ST/f/4/t/(.*)$ /read/t$1\.html [R=301,L]
RewriteRule show.php/act/ST/f/22/t/(.*)$ /read/t$1\.html [R=301,L]
RewriteRule show.php/act/ST/f/5/t/(.*)$ /read//t$1\.html [R=301,L]
RewriteRule show.php/ar /media_archive/files/Glossaries\ and\ Dictionaries/ [R=301,L]
==========
Is there something I'm doing wrong which is preventing what you gave me from working?
Welcome to WebmasterWorld!
There was no provision in your rule for the SID. You'll need to modifiy the pattern:
RewriteCond %{THE_REQUEST} ^[A-Z]+\ /forum/index\.ph[b]p\?.*s[/b]howtopic=([0-9]+)\ HTTP/
Jim
Also, for the sake of mentioning it, this has all been about redirecting an Invision Power Board (the lo-fi or lofiversion to be exact)
Cheers, and thanks again for both your guidance/assistance.