General Community > Scripting Help
Mod Rewrite
MrPhil:
--- Code: ---RewriteEngine On
RewriteCond %{REQUEST_URI} !^/smf2 [NC]
RewriteRule ^smf/?(.*)$ /smf2/$1
--- End code ---
Marsh:
Thanks guys, though i am still having some trouble.
--- Quote from: Antes on July 05, 2012, 04:32:32 AM ---
--- Code: ---Redirect 301 / http://www.touchofdeathforums.com/smf2/
--- End code ---
place it to your smf (not smf2) folder's .htaccess
--- End quote ---
This redirected to http://www.touchofdeathforums.com/smf2/smf and broke all my images.
--- Quote from: MrPhil on July 05, 2012, 11:25:45 AM ---
--- Code: ---RewriteEngine On
RewriteCond %{REQUEST_URI} !^/smf2 [NC]
RewriteRule ^smf/?(.*)$ /smf2/$1
--- End code ---
--- End quote ---
This did not seem to change anything.
Perhaps i am doing something wrong? I am simply uploading it as a .htaccess file in my smf directory. Any other ideas? Would be greatly appreciated.
Arantor:
Seems like there should be some kind of RedirectBase directive in there too, probably RedirectBase /
MrPhil:
--- Quote from: Marsh on July 05, 2012, 10:08:16 PM ---
--- Quote from: MrPhil on July 05, 2012, 11:25:45 AM ---
--- Code: ---RewriteEngine On
RewriteCond %{REQUEST_URI} !^/smf2 [NC]
RewriteRule ^smf/?(.*)$ /smf2/$1
--- End code ---
--- End quote ---
This did not seem to change anything.
--- End quote ---
You could try adding [R=301,L] on the last (RewriteRule) line, so it will show up in the browser address bar.
--- Quote ---Perhaps i am doing something wrong? I am simply uploading it as a .htaccess file in my smf directory. Any other ideas? Would be greatly appreciated.
--- End quote ---
Ah, yes you are doing something wrong. It should be in the root .htaccess (/.htaccess).
Marsh:
Alright that worked, Thank you MrPhil.
Unfortunately about half the forum is still running on the smf folder. As bad as that sounds. Is there anyway it can only redirect topic links and not themes and attachments. Because this completely strips my theme. I have a good amount of custom edits done and it would require a bit of work to redo the theme directory. It could probably be done. The attachment directory on the other hand contains thousands of files and gigabytes of info that would take weeks to move.
If not that is fine. Thanks for the help so far.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version