Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
.htaccess adding "www"
I have a hand-coded main site with a textpattern blog in the /blog directory. I’ve used a rewrite rule in / to force the “www” in the url. It works for all subdirectories except the /blog where I’m using the standard .htaccess provided by the indtall. I thought the directive would pass down the the /blog subdirectory, but it doesn’t seem to do that. How can I get the blog to force the use of www?
Thanks.
james
Offline
Re: .htaccess adding "www"
Try adding the same rule in the htaccess file in the blog directory above the txp stuff…. haven’t tested but I think it should work
Offline
Re: .htaccess adding "www"
Last time I tried that it didn’t work.
Offline
Re: .htaccess adding "www"
what do you have in the root htaccess now?
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: .htaccess adding "www"
Have you seen WWWizer? It’s free redirect to your domain with www.
Here’s url
But I might misunderstand you, don’t blame.
Last edited by maratnugmanov (2013-03-09 00:36:41)
Offline
Re: .htaccess adding "www"
In the site root I have a rewrite rule to add www to the url so that I can use CloudFlare. I was hoping that would pass down to the blog, but it doesn’t. Can I add the .htaccess from the blog to the one in the root? Would that help make all the urls www.wanderingitaly.com?
Offline
Re: .htaccess adding "www"
Try to add this in your root htaccess and do let us know the results
RewriteCond %{HTTP_HOST} ^wanderingitaly.com [NC]
RewriteRule ^(.*)$ http://www.wanderingitaly.com/$1 [L,R=301]
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: .htaccess adding "www"
That’s exactly what I have in there (as well as some catching stuff) , but you can access the blog with http://wanderingitaly.com/blog and it doesn’t redirect to www.wanderingitaly.com/blog, but it does add the www. to the files in the hand-coded part of the site just fine.
Offline
Re: .htaccess adding "www"
where have you got in in the file though? I normally put all my domain rewriting above the txp stuff to make it work on my server.
I still think rewriting the permlink should have the option in the core (like I mentioned here) – but I think I’m alone on that one
Offline
Re: .htaccess adding "www"
That’s the problem, I have the .htaccess in the root, then the textpattern .htaccess in the /blog directory.
Offline
Re: .htaccess adding "www"
Well in the htaccess file in your blog directory – make sure it looks something like the below (which I think is the standard htaccess file) – note the comments and code below them “#Your www domain rewrite”, “# Begin txp htaccess “, “# Specify your subdomain” – let us know how you go.
#Your www domain rewrite
RewriteEngine On
RewriteCond %{HTTP_HOST} ^wanderingitaly.com [NC]
RewriteRule ^(.*)$ http://www.wanderingitaly.com/$1 [L,R=301]
# Begin txp htaccess
#DirectoryIndex index.php index.html
#Options +FollowSymLinks
#Options -Indexes
#ErrorDocument 403 default
<IfModule mod_rewrite.c>
RewriteEngine On
# Specify your subdomain
#RewriteBase /blog/
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(.+) - [PT,L]
RewriteCond %{REQUEST_URI} !=/favicon.ico
RewriteRule ^(.*) index.php
RewriteCond %{HTTP:Authorization} !^$
RewriteRule .* - [E=REMOTE_USER:%{HTTP:Authorization}]
</IfModule>
#php_value register_globals 0
# SVG
AddType image/svg+xml svg svgz
AddEncoding gzip svgz
Offline
Re: .htaccess adding "www"
That just redirects it to the home page, www.wanderingitaly.com.
Offline