Jump to content

  • Log in with Facebook Log in with Twitter Log In with Google      Sign In   
  • Create Account

Subscribe to HRA Now!

 



Are you a Google Analytics enthusiast?

Share and download Custom Google Analytics Reports, dashboards and advanced segments--for FREE! 

 



 

 www.CustomReportSharing.com 

From the folks who brought you High Rankings!



Photo

How To Put Blog As Main Url Until Site Is Ready To Launch?


  • Please log in to reply
8 replies to this topic

#1 doogie88

doogie88

    HR 4

  • Active Members
  • PipPipPipPip
  • 260 posts

Posted 12 May 2009 - 02:23 PM

How can I safely, without messing with SER, make my url point to my blog? In layman terms.
ie
When people go to www.mysite.com I want it to really be www.mysite.com/blog/ and not have to click on links. Then when my site is ready the main site will be at www.mysite.com and link to the blog?

#2 Randy

Randy

    Convert Me!

  • Moderator
  • 17,540 posts

Posted 12 May 2009 - 08:23 PM

Are you on a Linux/Unix or IIS server Doogie?

It sounds like you're looking for a 301 redirect, but we need to know what type of server to give you an answer. Or you can review the 301 Permanent Redirects over in Technology and Coding. It has examples for both server flavors.

#3 doogie88

doogie88

    HR 4

  • Active Members
  • PipPipPipPip
  • 260 posts

Posted 12 May 2009 - 09:49 PM

QUOTE(Randy @ May 12 2009, 08:23 PM) View Post
Are you on a Linux/Unix or IIS server Doogie?

It sounds like you're looking for a 301 redirect, but we need to know what type of server to give you an answer. Or you can review the 301 Permanent Redirects over in Technology and Coding. It has examples for both server flavors.


linux. I know a bit about 301 for when you move pages, but I asked because it's not permanent, so not sure how it needs to be handled.

#4 Randy

Randy

    Convert Me!

  • Moderator
  • 17,540 posts

Posted 13 May 2009 - 06:29 AM

Yeah, I can see how you could worry about that one. The thing about stuff on the web is Permanent is never really Permanent. It's only Permanent until it's changed. giggle.gif

A quick and dirty .htaccess to redirect a few versions of the index file and root level to the /blog/ subdirectory.

CODE
RewriteEngine on
RewriteCond %{REQUEST_URI} ^/$ [OR]
RewriteCond %{REQUEST_URI} ^/index\.(html|htm|php)
RewriteRule ^(.*)$ /blog/? [R=301,L]



#5 doogie88

doogie88

    HR 4

  • Active Members
  • PipPipPipPip
  • 260 posts

Posted 13 May 2009 - 11:28 AM

Thank you.
Time to get started!

#6 doogie88

doogie88

    HR 4

  • Active Members
  • PipPipPipPip
  • 260 posts

Posted 15 May 2009 - 11:38 PM

Another question. I want to be able to edit and view my front page while it is redirecting. Is there no way around that?

#7 Randy

Randy

    Convert Me!

  • Moderator
  • 17,540 posts

Posted 16 May 2009 - 06:31 AM

Sure, there are several ways to do it.

If you have a fairly static IP number from your ISP, meaning you keep the same IP until you log on and log off and you don't normally do that, you could allow just your IP number or IP number range to access the index page. To allow your whole IP number and only it would look like:

CODE
RewriteEngine on
RewriteCond %{REQUEST_URI} ^/$ [OR]
RewriteCond %{REQUEST_URI} ^/index\.(html|htm|php)
RewriteCond %{REMOTE_ADDR} !^123\.123\.123\.123$
RewriteRule ^(.*)$ /blog/? [R=301,L]


To be a bit more open and allow an range of IP number, in case yours changes but say for instance the first three octets always stay the same it would look like:

CODE
RewriteEngine on
RewriteCond %{REQUEST_URI} ^/$ [OR]
RewriteCond %{REQUEST_URI} ^/index\.(html|htm|php)
RewriteCond %{REMOTE_ADDR} !^123\.123\.123\.
RewriteRule ^(.*)$ /blog/? [R=301,L]


There are several tools out there that will let you see what IP number you're currently connected with. Doing a search for something like What's my IP address should turn up several options.

Or if you wanted to make it a bit easier on yourself you could set up a temporary special variable that you'd use when accessing the index page that allows you to see it but which the search engines wouldn't know to look for. Say you call this special variable "specvar" and made it so that the value "me" would allow you to see the page, that would look like:

CODE
RewriteEngine on
RewriteCond %{REQUEST_URI} ^/$ [OR]
RewriteCond %{REQUEST_URI} ^/index\.(html|htm|php)
RewriteCond %{QUERY_STRING} !specvar=me
RewriteRule ^(.*)$ /blog/? [R=301,L]


Then you'd access the page with an address of www.yoursite.com/index.php?specvar=me and you'd be able to see the page. But traffic to just plain old www.yoursite.com/ or www.yoursite.com/index.php would still get redirected to the /blog/ subdirectory. If you use this method it would probably be wise to also use a meta robots tag to tell the engines not to index/archive the page just to be safe, in case they do ever find it.

#8 doogie88

doogie88

    HR 4

  • Active Members
  • PipPipPipPip
  • 260 posts

Posted 16 May 2009 - 08:17 AM

Thx so much. I have static IP I will use that.

#9 Randy

Randy

    Convert Me!

  • Moderator
  • 17,540 posts

Posted 16 May 2009 - 08:27 AM

A quick caution. Make sure to remember the \ (backward slash escapes) just before each period character in your IP number rewrite condition. Those periods have a special meaning in Regex. The escapes tell the server to treat them as literal characters.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

SPAM FREE FORUM!
 
If you are just registering to spam,
don't bother. You will be wasting your
time as your spam will never see the
light of day!