View Full Version : Making a sub page into your start page.
Valerij
12-02-2007, 10:54 AM
Hi, I installed WordPress on my site and used directory /home, and since the only thing I use my site for is that WordPress page, so I asked someone I know how to fix this and he redirected the .htaccess so now when you type in my page address you get to the WordPress page. But that means I cant view anything else besides the blog, so if I upload a file called test.html and then go to www.mypage.com/test.html it opens the blog.. So my question is; is there a way I can make a shortcut or whats its called so it opens my subpage, example: my page name is www.mypage.com and my blog is on www.mypage.com/blog
what I want is to open www.mypage.com/blog when i type in www.mypage.com and so I still can view other files like www.mypage.com/test.html and not just go to www.mypage.com/blog like it is right now..
Basil
12-02-2007, 10:58 AM
What is in the htaccess file?
Valerij
12-02-2007, 12:58 PM
# BEGIN WordPress
# END WordPress
Redirect 301 /index.html http://www.valerijgames.com/home
Redirect 301 /index.php http://www.valerijgames.com/home
Redirect 301 /index.htm http://www.valerijgames.com/home
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . home/ [L]
</IfModule>
Basil
12-02-2007, 02:12 PM
These lines..
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
tell it to only redirect if the requested file or directory don't exist.
If you make a file called test.html under public_html, you shouldn't have any problem getting to it from yourdomain.com/test.html.
The only problem here is that you've got these three lines..
Redirect 301 /index.html http://www.valerijgames.com/home
Redirect 301 /index.php http://www.valerijgames.com/home
Redirect 301 /index.htm http://www.valerijgames.com/home
They tell the server to redirect any file called index.html, index.php or index.htm to your blog. You might want to adjust that, as any subfolder with an index file is going to be affected.
I would remove those lines and remove any index file you may have under your public_html folder, I believe the server looks at default.html for an index if it runs out of index files
(http://valerijgames.com/default.html exists btw).
You can use the default.html thing to your advantage like this..
Redirect 301 /default.html http://www.valerijgames.com/home
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . home/ [L]
</IfModule>
That way it won't redirect your real index files, only requests for default.html. Hope that helps you.
Valerij
12-03-2007, 12:11 PM
Well, it just shows the code on the page now, it think its something wrong with it.. :(
Basil
12-03-2007, 12:16 PM
That should be in your htaccess file.
It's for redirecting requests to default.html to your home directory.
Alright, never mind, that doesn't work right. Hold on.
Sorry I'm not used to the "redirect" directive.. try this:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . home/ [L]
RewriteRule ^default.html$ http://www.valerijgames.com/home [r=301]
</IfModule>
And just to make sure, put <meta http-equiv="refresh" content="0;url=http://www.valerijgames.com/home" /> in your default.html file.
Valerij
12-03-2007, 01:23 PM
Well yeah, its better, but i still cant open files in other folders than home, example:
www.valerijgames.com/games/race.10.swf
Basil
12-03-2007, 03:07 PM
http://valerijgames.com/games/Race10.swf
Linux is case sensitive.
litebulb1
12-14-2007, 08:19 PM
Using this code:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . home/ [L]
RewriteRule ^default.html$ http://www.valerijgames.com/home [r=301]
</IfModule>
is there any way so that when the view goes to http://www.valerijgames.com they don't see the /home at the end of the address?
Basil
12-15-2007, 12:13 AM
Yes, just remove [r=301].
litebulb1
12-15-2007, 02:43 AM
This is what ive got and it didnt remove drupal from the address.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . drupal/ [L]
RewriteRule ^default.html$ http://www.litebulb1.com/drupal
</IfModule>
Im not sure if im going about this the right way but I would like to have www.litebulb1.com point to the drupal directory without the /drupal at the end of the address.
Basil
12-15-2007, 05:06 AM
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . drupal/ [L]
RewriteRule ^default.html$ /drupal/
This will redirect any request for a file or directory that doesn't exist directly under your domain to the drupal directory, it will also redirect any request for any default.html file to the drupal directory. Apparently putting the domain in the path makes it automatically do a 301 redirect for some reason, even if it's the same domain. I know for a fact that didn't used to be like that since I've used it on my domain.
If you only want to redirect your main domain to the drupal directory you could just use this..
RewriteEngine On
RewriteBase /
RewriteRule ^default.html$ /drupal/
vBulletin® v3.7.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.