bbPress Forum - rewrite to wwww.mysite prohibits login - redirect

I am using bbPress installation without WordPress integration.
The redirect of the RewriteEngine at the forum site works:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^forum.mysite.com$
RewriteRule (.*)$ http://www.forum.mysite.com/$1 [R=301,L]
The problem is the login into ppPress.
bbPress login does not recognize: http://www.forum.mysite/bb-login.php.
It redirects to: http://forum.mysite.com/bb-login.php.
I tried permalink settings none and name based, same issue.
Does anyone uses redirect in bbPress or how can I eliminate "double" content and redirect permanently to www.?

I redirected from www.forum.mysite.com to forum.mysite.com and achieved to eliminate "double" content.

Related

301 redirect htaccess and Nginx settings issues and .composer folder

I've had some hit and miss results setting up htaccess to forward on a couple of aged domains I acquired to my main site. I wouldn't describe myself as advanced more an enthusiastic intermediate so a nudge in the right direction would be greatly appreciated. I've checked answers but nothing definitive that I can see that relates to my specific issue and the composer folder. In Apache/Nginx I have in directives (http/https)
RewriteEngine On
ErrorDocument 404 https://my-main-site.com/my-page-or-blog-post/
I have 'Restrict the ability to follow symbolic links' unchecked as I have reference to symlinks in htaccess and so avoids a 500 error. I also have put up a static html page so if anyone hits the old aged domain it's not an automatic redirect they'll see the static HTML page with reference to the old/aged domain. So the 301 is sort of in the background but I'm getting a 302 result. My htaccess looks like this......
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^old-site-aged-domain.com$ [NC]
RewriteRule ^(.*)$ https://my-main-site.com/my-page-or-blog-post/ [R=301,L]
However when I go in to AHREFS and look at the backlink data it's showing a 302, however it does confirm http>https is working fine.
http://www.old-site-aged-domain.com/info-page.html
301
https://www.old-site-aged-domain.com/info-page.html
302
https://my-main-site.com/my-page-or-blog-post/
In my site root I also have .composer folder (as well as error_docs, .ssh, httpdocs, logs, .revisium_antivirus_cache), I'm sort of aware what the purpose of this is (PHP) but there are 2 further htaccess files in there, the second smaller htaccess file only has 'deny from all' as content. I wonder if this folder with these 2 htaccess files is presenting a problem/conflict i.e. 3 x htaccess files. The smaller htaccess file is in .composer/cache. The larger htaccess file is in .composer. Should I delete these 2 x htaccess files in .composer folder.
Thanks in advance for any help
James
rewrote htaccess on numerous occasions but without success

Typo3 v10 site configuration with a www-subdomain

I created a site configuration in Typo3 10.4.11 for the entry point www.example.com. When browsing to example.com (without www), I get an error message:
Page Not Found The page did not exist or was inaccessible. Reason: No
site configuration found.
I tried to create a static route, which didnĀ“t work. Any other ideas how to redirect to the original page from www.example.com as well as example.com?
If you're running on Apache, I'd suggest to add a redirect to your .htaccess file:
RewriteCond %{HTTP_HOST} ^example\.com$
RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]
Put the snippet near to the line with RewriteEngine On.
If you want to have both domains served by TYPO3, then the EXT: host_variants may be an option.
https://github.com/b13/host_variants

Facebook share Og:image error, when image is only less than 200kb

Facebook debugger
https://developers.facebook.com/tools/debug/sharing/?q=http%3A%2F%2Fepaper.sinchew.my%2Fsinchewepaper%2Fmobimax%2Freader%2Fmagazine%2Fasd.php
I kept getting this message
Provided og:image...image link ... could not be downloaded because it exceeded the maximum allowed sized of 8Mb or your server was too slow to respond.
The image is only around 200KB.
Why does this happen? Pls Help!
I had the same problem but it was solved. In my case, .access file concerned it. If you set a .access file on your images directory and restrict accesses from others than home directory, you may need to change your settings or environment.
+1 for Alexandre T's answer
For me, this problem had to do with my .htaccess file in the root directory of my website.
There was a section enabling hotlink protection, in other words blocking anyone except referrers I specified from accessing my website's image files. Facebook wasn't in that list of allowed referrers, so that's why my images weren't showing up no matter how many times I re-scraped, or whether or not I had specified og:image:height and og:image:width.
The rules that blocked hotlinking may get added to your .htaccess file without you ever actually manually editing it--some servers like BlueHost have a one-click way to enable hotlink protection in your site's cPanel settings.
To fix this, I did two things. I'm pretty sure that the second action does not work on its own and it's probably unnecessary, but I included it b/c you may want to add search engines to your allowed referrers like I did. Here goes:
1) I chose to allow direct requests (which from what I understand is not the same thing as allowing hotlinking, in other words it still provides some hotlink protection)
2) I added a rule that allows facebook.com and fbcdn.net to the list of allowed referrers (along with google, yahoo, bing for good measure)
You can accomplish both of these steps either by using the cPanel Hotlink Protectio module which is a more "user-friendly" interface, or you can edit your .htaccess file directly in file manager or via FTP (and as always, you should back up you .htaccess before you make any changes to it! one mistake and your website won't work at all, but with a backup it only takes a second to replace it with the most recent working version).
hotlink-protection
(screen shot of the hotlink protection module in cPanel, BlueHost)
configure-hotlink-protection
(screen shot of hotlink protection settings)
To do step 1 in cPanel, go to hotlink protection, check the box next to "Allow direct requests." Then to do step 2 in cPanel, also add this line into the List of URLS to which you wish to allow access:
($|(http|https):\/\/.*(google\.com|yahoo\.com|bing\.com|facebook\.com|fbcdn\.net))
Then save or submit.
To do it by editing your site's .htaccess, once you've created a backup, find the area of the file related to hotlink blocking - for me it was at the end of my .htaccess, not sure where it will be for you.
If you're not sure what to look for, you can search for jpg in the file, because the rewrite rule will include the file extensions being targeted (like png, jpg, jpeg, etc)
This is what the whole hotlink blocking section looked like for me:
RewriteCond %{HTTP_REFERER} !^http://yoursitename.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://yoursitename.com$ [NC]
RewriteCond %{HTTP_REFERER} !^http://dns.yoursitename.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://dns.yoursitename.com$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.dns.yoursitename.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.dns.yoursitename.com$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.yoursitename.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.yoursitename.com$ [NC]
RewriteCond %{HTTP_REFERER} !^https://dns.yoursitename.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^https://dns.yoursitename.com$ [NC]
RewriteCond %{HTTP_REFERER} !^https://yoursitename.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^https://yoursitename.com$ [NC]
RewriteCond %{HTTP_REFERER} !^https://www.dns.yoursitename.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^https://www.dns.yoursitename.com$ [NC]
RewriteCond %{HTTP_REFERER} !^https://www.yoursitename.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^https://www.yoursitename.com$ [NC]
RewriteRule .*\.(jpg|jpeg|gif|png|bmp)$ - [F,NC]
I'm sure there's a way to concentate all those rules but I personally don't know what it is and I like to keep my tampering in .htaccess to a minimum because I'm not fully comfortable with the syntax.
To do step 1, at the top of this section you can add this line to allow direct requests, which is the same thing as checking the box in cPanel to "Allow direct requests":
RewriteCond %{HTTP_REFERER} !^$
Then to do step 2 and add Facebook, fbcdn (Facebook's CDN or content delivery network), as well as the major search engines, as allowed referrers (notice that this syntax is more streamlined and it includes the https://, http://, www, and non-www versions of the sites):
RewriteCond %{HTTP_REFERER} !^($|(http|https):\/\/.*(fbcdn\.net|facebook\.com|google\.com|yahoo\.com|bing\.com)) [NC]

PrestaShop: non-www URLs redirecting to 404 error page

I am experiencing a weird issue on my PrestaShop website.
When I am opening an URL without WWW on it, it redirects to the WWW page, but displays 404 page.
for example, when I am trying to access http://mydomain.com/home/contact-us it takes me to http://www.mydomain.com/home/contact-us?controller=404. It should not add ?controller=404 to the end of the url. Why it's doing this and how to fix this issue?
You need to manually edit the .htaccess file of your Prestashop website. You can redirect all non-www urls to add www using this code.
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
Place the code on top of your .htaccess file or within the condition block for checking mod_rewrite
you can set your url under "Preferences > SEO & URLs". you have to change the options "Shop domain" and "SSL domain" there you can set with or without "WWW".
This is most probably cased by not-generated .htaccess file. Go to BackOffice -> Preferences -> SEO & URLs and click [Save]. This will regenerate your .htaccess file.

redirect 301 all pages that doesn't exist to a new directory

i had build another website in the directory http://www.example.com/newwebsite/
Now all the old pages that doesn't exist on the website i want to redirect them to http://www.example.com/newwebsite/
I have a lot of pages in google webmaster with 404 error , that i want to resolve it. I understand that a 301 redirect will resolve my problem.
Can you help me with the htaccess to redirect the pages that doesn't exist any more?
thank you
Try this:
RewriteEngine On
RewriteCond !%{REQUEST_URI} ^/newwebsite/
RewriteRule (.*) /newwebsite/$1 [R=301,L]