The Arcive of vBulletin Modifications Site. |
|
|
#1
|
||||
|
||||
|
Hi, I liked to redirect my non www. urls of my homepage to the www. urls
Ex http://nihonomaru.com/ should redirect to http://www.nihonomaru.com/ However, when i applied this rule to the .htaccess RewriteEngine On RewriteCond %{HTTP_HOST} !^www\. RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L] It is working but now on my forum, where i host my images on lightspeed, img1 subdomain, the images aren't appearing because they also get redirected i.e., img1 gets redirected to www.img1 See http://img1.nihonomaru.com/lighttpd/...edals/1231.gif How can i apply an exclusion rule so the redirect doesn't not affect sub-domains? Or for only to apply the redirect for the homepage pages only? Code:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/forum/(.*)
RewriteCond %{REQUEST_URI} !^/img1/(.*)
RewriteCond %{REQUEST_URI} !^/cache/(.*)
RewriteCond %{REQUEST_URI} !^/lighttpd/(.*)
RewriteCond %{REQUEST_URI} !^forum\.nihonomaru\.com
RewriteCond %{REQUEST_URI} !^img1\.nihonomaru\.com
RewriteCond %{REQUEST_URI} ^/chan.*
RewriteRule (.*) - [L]
RewriteCond %{REQUEST_URI} "/lighttpd/"
RewriteRule (.*) $1 [L]
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.
RewriteCond %{REQUEST_URI} !^img1\.nihonomaru\.com
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
RewriteCond %{HTTP_HOST} ^(www\.)?nihonomaru.com$
RewriteRule ^$ public/ [L]
RewriteCond %{HTTP_HOST} ^(www\.)?nihonomaru.com$
RewriteRule (.*) public/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [QSA,L]
</IfModule>
|
|
#2
|
||||
|
||||
|
Try
Code:
RewriteEngine On
RewriteCond %{HTTP_HOST} !^img1\. [NC]
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
|
| Благодарность от: | ||
| katie hunter | ||
|
#3
|
||||
|
||||
|
Hi vBNinja,
I added it to my .htaccess but I see an internal server error message. Quote:
Code:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/forum/(.*)
RewriteCond %{REQUEST_URI} !^/cache/(.*)
RewriteCond %{REQUEST_URI} !^forum\.nihonomaru\.com
RewriteCond %{REQUEST_URI} ^/chan.*
RewriteRule (.*) - [L]
RewriteEngine On
RewriteCond %{HTTP_HOST} !^img1\. [NC]
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
RewriteCond %{HTTP_HOST} ^(www\.)?nihonomaru.com$
RewriteRule ^$ public/ [L]
RewriteCond %{HTTP_HOST} ^(www\.)?nihonomaru.com$
RewriteRule (.*) public/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [QSA,L]
</IfModule>
|
|
#4
|
|||
|
|||
|
Here you go.
Code:
### BEGIN CLOUDFLARE REWRITE (domainB.com to www.domainB)
RewriteEngine on
RewriteCond %{HTTP_HOST} ^domain.com$ [NC]
RewriteCond %{SERVER_PORT} ^80$
RewriteRule ^(.*)$ http://www.domain.com/$1 [R=301,L]
### END CLOUDFLARE REWRITE ###################
|
|
#5
|
||||
|
||||
|
Quote:
Hi, why identifying it as specifically redirect everything on port 80 to the http URL? |
|
#6
|
||||
|
||||
|
Side Note: You have a 404 missing or incorrectly named image here:
HTML Code:
URL: http://forum.nihonomaru.com/images/styles/OrangeTheme/style/headerBG.gif Host: forum.nihonomaru.com IP: 141.101.117.217 Location: Cloudflare Error/Status Code: 404 Client Port: 56304 Start Offset: 1.308 s Time to First Byte: 39 ms Content Download: 0 ms Bytes In (downloaded): 0.6 KB Bytes Out (uploaded): 0.6 KB |
|
#7
|
|||
|
|||
|
Not too sure if that matters too much but that's what I've come up with after browsing through several tutorials & articles.
Also I realize that this plugin is a vb3 plugin but it still seems to get the job done in vb4 as well (I've used it for a couple of years now). https://vborg.vbsupport.ru/showthread.php?t=222898 |
|
#8
|
||||
|
||||
|
Quote:
I can't seem to find where this url is in the template. Code:
#headerMain {
background: url(azskinz/nihonomaru/style/headerBG.gif) repeat-x scroll left top transparent;
height: 96px;
padding: 0 20px;
position: relative;
}
Quote:
I don't really have an issue with my forum url, it is working perfectly, my issue is for the sub domain img1 which is lightspeed that is hosting my forum images. |
|
#9
|
|||
|
|||
|
Sorry about that, been posting while I'm half awake over here.
Try this solution. http://stackoverflow.com/questions/1...ailing-slashes |
|
#10
|
||||
|
||||
|
We can check it tomorrow
thanks for your help! I tried it but it didn't work: Code:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/forum/(.*)
RewriteCond %{REQUEST_URI} !^/cache/(.*)
RewriteCond %{REQUEST_URI} !^forum\.nihonomaru\.com
RewriteCond %{REQUEST_URI} ^/chan.*
RewriteRule (.*) - [L]
#Force www.
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP_HOST} ^nihonomaru\.com$ [NC]
RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
RewriteCond %{HTTP_HOST} ^(www\.)?nihonomaru.com$
RewriteRule ^$ public/ [L]
RewriteCond %{HTTP_HOST} ^(www\.)?nihonomaru.com$
RewriteRule (.*) public/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [QSA,L]
</IfModule>
I also added this part as well and it didn't work, unless i did something wrong Code:
#Remove trailing slash
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{HTTP_HOST} ^www\. [NC]
RewriteRule ^(.+)/$ /$1 [R=301,L]
|
![]() |
|
|
| X vBulletin 3.8.12 by vBS Debug Information | |
|---|---|
|
|
More Information |
|
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|