Hello there; in my website, I use the root directory for my main script "vBulletin" now I want to move my vBulletin script into a child-directory "forums" and use the main dir for another script. I use vBseo for URL re-writing and the option I use for re-writing is t[thread_id]/[thread_title].html Code (markup): example http://www.example.com/t20836/thread-title.html Code (markup): RECOMMENDED I want to move it to http://forums.example.com/t20836/thread-title.html Code (markup): or please not, that I can't use this mod_rewrite Options +FollowSymLinks RewriteEngine on RewriteRule (.*) http://forums.example.com/forums/$1 [R=301,L] Code (markup): because if I did I won't be able to use the main directory of my domain I think if we could find a way to get the [thread_id] from the folder name and redirect the visitor to /forums/showthread.php?t=[thread_id] I think then the problem will be solved. Any ideas? hope someone can help.
Problem solved using RewriteEngine On Options +Indexes Options +FollowSymlinks RewriteRule ^t(.*)/(.*)\.html$ http://www.example.com/forums/showthread.php?t=$1 [R=301] Code (markup): I've found that solution after 5 hours googling and reading different articles, and actually this one was the most helpful. http://forums.digitalpoint.com/showthread.php?t=23044 Code (markup):
That is the best solution to this kind of redirect problems. With it you match only the files you want. It should work fine.