cancel
Showing results for 
Search instead for 
Did you mean: 

htaccess rewrite help

OooohMatron
Newbie
Posts: 1
Registered: ‎07-07-2010

htaccess rewrite help

Hi all
I'm very new to websites and apache, wordpress and PHP.  I'm looking to setup Wordpress in my ccgi space and have it form part of my existing website which is located in the standard web space.  I have a domain name registered with plusnet which points to the standard space and I'd also like that domain name to appear in the browser address bar when visitors to the website click on the blog section.
After a lot of digging on the net and in these forums it appears I need to use a redirect and then a rewrite within a .htaccess file to achieve the desired effect.
I've created a .htaccess file in the standard web space that redirects users who visit http://www.mydomain.co.uk/blog to http://ccgi.username.force9.co.uk to load up the wordpress index.php file - this is working.  However I cannot get the rewrite to work, whatever I do http://ccgi.username.force9.co.uk shows in the browser address bar. 
What rewrite code do I need to use and where should it be?  Should it go in the .htaccess file in the standard webspace or in the ccgi space?
I've tried the following in the .htaccess file in the ccgi space with no joy...
RewriteEngine on
RewriteBase /
RewriteCond %{HTTP_HOST} ^www.mydomain.co.uk$ [nc]
RewriteRule (.*)

Any help much appreciated!
2 REPLIES 2
TLE
Grafter
Posts: 110
Registered: ‎01-12-2009

Re: htaccess rewrite help

The re-write rule is doing exactly what you have told it to do, and the browser address bar reflects this. So if a user types in http://www.mydomain.co.uk/blog ; into there address bar, the web server re-writes it as http://ccgi.username.force9.co.uk.
I think you what you should really be doing is having your domain pointed to your CGI space. You should take a look at the following thread http://community.plus.net/forum/index.php/topic,86525.0.html
Hope this helps.
Gabe
Grafter
Posts: 767
Registered: ‎29-10-2008

Re: htaccess rewrite help

Hi OM,
If I understand what you're trying to do correctly, you can't use a rewrite to fake the host. You could use a frameset as the index to your blog directory and point the frame at your blog - the url bar would display http://www.mydomain.co.uk/blog and wouldn't change as you navigate the blog. Or, you could point the ccgi subdomain of mydomain at the ccgi platform, if you'd be happy with the url bar displaying http://ccgi.mydomain.co.uk/. Or, you could move the rest of your site to ccgi and point the domain and www at that. If that makes sense.
Gabe
edit: tle beat me to it.