Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.