Wordpress trailing slash in permalink address causes a 404 - wordpress

For some reason my Wordpress install now requires a trailing slash after the page name.
For instance http://somedomain.com/page-name (404's)
Yet http://somedomain.com/page-name/ (serves the correct page)
I wonder whether this is just because of a stricter Apache server on the remote server i've just uploaded it too, compared to that of my local environment.
Needless to say though it would be great to get a suggested fix in place :)

Please check below links.
wordpress mu 404 without end slash
http://yamz.wordpress.com/2009/09/21/trailing-slash-in-wordpress-permalink-causes-404-error-in-ie/
It will work , sure..

Related

Trying to rewrite URLs for wordpress / nginx / WPML install

I have some wordpress experience, but it's my first time using Nginx. I have a WordPress installation running on Nginx. I added WPML (multi-language plugin) https://wpml.org/
The current URL structure is https://www.maindomain.com/blog/es/.... & https://www.maindomain.com/blog/en/.... etc. Everything works fine.
I'm looking for a way to rewrite the URLs in ninginx conf for the whole set-up to work with: https://www.maindomain/es/blog/.... instead of https://www.maindomain.com/blog/es/ and so on.
I tried several things and eventually i got stuck on:
rewrite ^/blog/en/(\w+\.?.*)$ /en/blog/$1 last;
which gives a 404 error on both URLs.
Any ideas on how to do this? Or is there a better way of doing this other than with rewrites?
...is there a better way of doing this
Possibly, yes. You can install WordPress in a root directory instead of a subdirectory (/blog) or point the domain to the subdirectory. This will give you URLs like maindomain.com
You can then set the Language URL setting in WPML to "Different languages in directories". This will give you URLs like maindomain.com/es/. Finally, you can create a page with the blog slug in WordPress (you should be able to set the same slug for the translation) and it will be accessible at maindomain.com/blog or maindomain.com/es/blog.

redirected you too many times error on logging to word press

Hello everybody so iam trying to log-in to my Wordpress site but it is returning redirected you too many times. Error and i tried solving it using this tutorial https://www.wpbeginner.com/wp-tutorials/how-to-fix-error-too-many-redirects-issue-in-wordpress/ but removing my .htaccess didn't help
Note: This problem happened only after moving my WordPress from my old site to another and I had already changed the optian siteurl and homeurl from my Database
Checked recently those questions: wordpress blog. too many redirect error on chrome, blank page on FF (i didn't create any extra protection for wp-admin directory...)
please some help #everyone
my .htaccess file: https://downloads.br-gaming.cf/htaccess.txt
Looking at your .htaccess you have a lot of rewrite rules which overlap.
for instance, you are forcing all non-www to www and SSLand down in the file you also force subdomain traffic on SSL.
I would start by removing the lower portion of the files (Any part after #Prevent directory listings (No index) ) and add them as needed.
It may also be the way your DNS cnames and hostnames are setup

WordPress will not force SSL for the life of me

Hate to complain but I've spent like 2-3 hours working on trying to secure my WordPress site via SSL. I can successfully browse to my site via HTTPS, but I always get mixed content. I've tried several plugins, but there are still resources that are pulling images via HTTP. If I tried to browse to the URLs of those images manually, my web browser actually switches the URL to HTTPS, so I'm not sure why the site loads the images under HTTP but browsing to the images manually forces it over HTTPS. Very Confusing.
I've tried adding this in the .htaccess file of my root directory, so that all requests to the subdirectory /wp-content/ are forced over HTTPS, but it still does not work:
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^(wp-content/.*)$ https://www.example.com/$1 [R=301,L]
When I add this into the .htaccess file, reload the site, inspect element, I still see numerous links in here with http.
I've also tried HTTPS Easy Redirection, which forces HTTPS on everything but then results in a redirect loop. Still no luck.
Any suggestions would be greatly appreciated. It seems to just be the images.
What you have setup so far works, but does not address the root issue. As a matter of fact the .htaccess redirect is overkill.
Your Wordpress configuration needs to be edited. Go to your settings>general, ensure that the Wordpress Address Url and Site Address Url are https. It's that simple. You also need to edit any hard coded content urls to https.
You could use some wacky plugin to mutate your links but I would not advise it. But it won't work all the time. That will depend on how your content is constructed.
If you want to play it safe, whenever your add a resource link to content simply omit the protocol like this: ://example.com/.... That scenario works well with content generated by Visual Composer and the likes.
If the SSL is successfully installed in your server then use this plgin: https://wordpress.org/plugins/really-simple-ssl/
This will works for you...
Note: Take backup of your website and database first then proceed with the above plugin.
Thanks

localhost redirecting to search page

I have dowloaded wordpress 3.5 and xampp and they are succeessfully insatlled in windows 7 and also changed the wp-config.php file in wordpress and placed it in ht docs and also created a database. My problem is when i load localhost/phpmyadmin it appears and when i load localhost/wordpress/wp-admin/install.php it takes me to my home page which is http://static.flipora.com/websearch.html?ref_type=redirect&src_type=bg&tv=7.104&t=7.104&u=12606685. It takes here whenever i type localhost/(anything). Please tell me there is problem with my xampp or wordpress.
That's most likely malware.
See this to remove it
Some browsers need http:// prepended before localhost and similar URLs to work. On Chrome I need to add the http:// part to access localproject.dev URLs properly (otherwise it redirects to Google search). Firefox seems to work normally with these kinds of URLs.

Redirect non-trailing slash to trailing slash on homepage URL only

I have a two-part issue.
I am trying to implement a redirect only for the homepage URL to render with a trailing slash. Example: redirect www.domain.com to www.domain.com/ BUT allow all other URLs to render without a trailing slash.
End Goal:
www.domain.com/
www.domain.com/pages
www.domain.com/pages/post-name
This get complicated because there is one WordPress install with one .htaccess file but 6 other sites (with different domains) installed under the main WP install. I need to implement the trailing slash only on the homepage URL for a site that is mapped under the main install and shares the same .htaccess file with the main instal domain. So a rewrite base will only affect the main install domain, not the other 6 sites.
This is the first time I have encountered this kind of structure and it has me totally confused. Is this even possible to achieve? Thanks for any help!
There really is no need to force a trailing slash when there is no path, because if the path is empty, it is implied to be / already. Having the slash there or not will make absolutely no difference in the rendering of your pages or how Apache handles the request. Not to mention, redirecting users to have the / appended will just cause them to waste an extra HTTP request.
However, you can prevent Apache from adding the / to URLs which resemble a directory by using this:
DirectorySlash Off
Which will prevent /pages from becoming /pages/. Although, if a user manually types it in with the / at the end, it will still be there. Again, redirecting just to remove a / at the end is a waste.

Resources