PDA

View Full Version : Website redirect -.htaccess?



cmphoto
05-04-2011, 10:31 AM
I'm trying to redirect a site hosted on WH (mysite.com) to my blog, but can't figure out how to modify the .htaccess file. i've failed at several attempts, any input would be helpful.

the current .htaccess file looks like this:


# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /wordpress/home/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /wordpress/home/index.php [L]
</IfModule>

# END WordPress


How do I modify the file to redirect "www.mysite.com" to my worpress blog? (hosted on same site) and to a specific landing page in the blog (www.mysite.com/wordpress/home

thanks!

wildjokerdesign
05-05-2011, 07:53 AM
Try this in your public root. If you are on an older Site Manager account that is /var/www/html


# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule /wordpress/home
</IfModule>
# END WordPress

I think that should work for you. I am assumeing that you are using the SEO friendly urls in wordpress and have the .htaccess file they provide in the /var/www/html/wordpress directory.

CocoPero
06-07-2011, 03:45 PM
Hello, I'm new for this forum and I'm not sure that my question is related to this thread but somebody can help me, I appreciate for it.

I use b2evelution for my blog page and it is linked from my top page . It worked very well until last month (I'm not sure when the link started to not work).
The URL is as http://mydomain.com/myblog/index.php
Also, I can't access to the Log in page . it's like http://mydomain.com/myblog/admin.php

When I tried to see the page on the browser, the browser give a pop up window and ask, if I want to download this page.
I used to be able to see the page but not right now and suddenly. Why?
What I remember is I updated PHP version to 5.3.6 last month in my site manager. Is this related with this problem?

My blog is installed the directly , /var/www/html/myblog

WH customer support told me the ".htaccess " file may be something wrong but not sure. But I don't know which .htaccess file is wrong, the file /var/www/html/.htaccess or /va/www/html/myblog/.htaccess? The agent told me that he will ask to manager but unfortunately, I couldn't get any solution so far.
I checked the .htaccess file of myblog folder by FTP, the file is empty, nothing was written.

I still use Site Manager and my Top page is MIVA store front.
Is there any idea to solve this problem?

Thank you very much.

wildjokerdesign
06-07-2011, 04:20 PM
What if anything is in the /var/www/html/.htaccess file. With .htaccess files the server reads that one first and then would read the one in /var/www/html/myblog/.htaccess which means that the .htaccess file used for Miva that is in /var/www/html/.htaccess could be affecting things. Go ahead and post what is in /var/www/html/.htaccess and I'll give it a once over to see if I can figure out what WH support was talking about.

You aren't having any issues with Miva right?

CocoPero
06-07-2011, 05:52 PM
Hi, thank you for your response.
The /var/www/html/htaccess is as below.
I have no any issue for MIVA. While I have other pages such as HELP, Contact us which were made outside MIVA and sit at /var/www/html/HELP, it was linked correctly.
______________________________________
### Begin - Inserted by Miva Merchant

DirectoryIndex /mm5/merchant.mvc?Screen=SFNT

RewriteEngine On

RewriteRule ^mm5/admin.mvc? - [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^product/([^/.]+).html$ /mm5/merchant.mvc?Screen=PROD&Product_code=$1 [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^category/([^/.]+).html$ /mm5/merchant.mvc?Screen=CTGY&Category_code=$1 [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)/([^/.]+).html$ /mm5/merchant.mvc?Screen=PROD&Category_code=$1&Product_code=$2 [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/.]+).html$ /mm5/merchant.mvc?Screen=$1 [L]

### End - Inserted by Miva Merchant

CocoPero
06-09-2011, 04:22 PM
This problem was solved (finally could receive the solution from Tech support).

The issue was PHP which was not properly installed and they reinstalled and now works correctly.

Thank you for Westhost Tech support. :)

wildjokerdesign
06-09-2011, 05:15 PM
Good to hear! That was actually going to be my next suggestion if I did not see anything in your .htaccess file. Guess I should have mentioned that from the start, it may have gotten you back up and running faster but the fact that support made mentioned .htaccess made me think maybe they had seen something. Also I do know that with Gallery3 and some of the things it tries to put in the .htaccess file there are issues. I just moved someone to a new cPanel account and which had a newer version of PHP installed and I had to remove some directives from the .htaccess file. For anyone who may read this in the future that is a good place to look. You can always rename the .htaccess file to something like backup.htaccess just to test real fast if you are getting server errors. As a rule the things that program put in .htaccess are not vital to the running of the program but affect either extras or things like SEO URLS.