Jump to content

Quick .htaccess change?


Cory94bailly

Recommended Posts

Hi..

 

This is my current .htaccess (Given to me from users here on PhpFreaks ;))

RewriteEngine on

RewriteCond %{HTTP_HOST} ^(www\.)?MYSITE\.net [NC]
RewriteRule ^$ http://blog.MYSITE.net/ [R=301,L]
RewriteCond %{HTTP_HOST} ^(www\.)?MYSITE\.net [NC]
RewriteRule (.*) http://forum.MYSITE.net/$1 [QSA,R=301]

 

I would like it so if they go directly to MYSITE.net, it will go to the blog, which works fine.

 

And if they go to anything else (ex: MYSITE.net/lol.php >>> forum.MYSITE.net/lol.php), which also works fine.

 

But I would like it so if the file they are attempting to go to exists, let them go to it.. If it doesn't exist, redirect it to forums.MYSITE.net/WhateverTheyTyped

 

Also, how would I make it so if they go to certain files/folders, it gives them either a 404 or just redirects them?

 

Thanks guys! :)

Link to comment
https://forums.phpfreaks.com/topic/194199-quick-htaccess-change/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.