Wordpress Post Links With Wrong Day - wordpress

I am having a strange issue with a new multi-site wordpress installation. This is installed on a Magento website.
I can see my blog and go into the admin area just fine. However, when I click on a post I get a 404 error. If I change the day in the url it will work.
Example: If the link takes me to mysite.com/dev/devsite/default/blog/2013/11/11/hello-world/ I get the 404. But, if I manually change the day in the url to mysite.com/dev/devsite/default/blog/2013/11/12/hello-world/ I can see the post.
Here is my .htaccess file that the multi-site wordpress told me to use.
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /dev/devsite/wordpress/
RewriteRule ^index\.php$ - [L]
# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
RewriteRule . index.php [L]
</IfModule>
Any idea why this is?

I also have a WP MultiSite installation under my main website. Here's the .htaccess code used by my site.
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
RewriteRule . index.php [L]
Try using this instead of your ones. There is a ending too in your code, I think you copied the code wrong way.

Related

http:// redirect to http//

I got an issue with an unwanted redirection.
My Wordpress is redirect to http// instead of http://, the : are dissapearing.
Here is my .htaccess :
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
RewriteRule . index.php [L]
</IfModule>
# END WordPress
If anyone have any clues on this, that would be great !
Edit : Ok, I got it, the Multisite functions of Wordpress was the problem. Just did a clean reinstall of the site and that's good.

Changed sub-site path and facing 404

I was running a multi-site on www.madeinindia.club i have made a sub-site with www.madeinindia.club/work-space and now i changed the path to www.madeinindia.club/karmabhoomi but it is not accessible now. both URL showing 404
Note: I have already changed the same URL one time but then the new url worked.
htaccess file
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
# uploaded files
RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]
# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
RewriteRule . index.php [L]
Also posted on WordPress Developer

WP Site Network htaccess redirect to https

I use wordpress with a Site Network. Since I wanna use different kinda themes on the same domain it's necessary. To make this work I needed to change my htaccess file into what WP ordered me to. But then my redirection to https didn't work anymore.
I have the following htaccess code:
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
RewriteRule . index.php [L]
I wanna add a redirection to https:// w w w. for any access to the website.
Anything I do, in the end one of the former rules aren't working anymore. And afterwards the Wordpress Network Sites don't work anymore.
Any suggestions?
You need to keep redirection rule before your your WP rule:
RewriteEngine On
RewriteBase /
# http to https
RewriteCond %{HTTPS} off
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L,NE]
# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule . index.php [L]
Also don't forget to change permalink setting in WP to use https for your blog/site

Why does the URL include /blog/ on one of my Multisite WP sites and not the other?

Can some one tell me why I have one Multisite that includes a /blog/ in the url and the other one doesn't?
EG:
http://site1.com/blog/article
http://site2.com/article
How can I change this on a site by site basis?
And when I change it how should a redirect the current URLs to the new location.
What is the code for .htaccess file?
Thanks! :)
if you used the subdirectory install of WPMU the .htaccess must like the below
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
RewriteRule . index.php [L]

Add a RewriteRule for WordPress multisite

I have a brand new WP multisite network (v 3.5.1) on sub-directories. I'm getting an error with the images, where the subsites won't display them properly, but they are being uploaded correctly. I'm pretty sure all I need to do is add the correct RewriteRule to the .htaccess file in the main site, as such:
When an image is called from anywhere in the site, the URL is: example.com/subsitename/assets/sites/#/imagename.jpg. I want to change it so that the image actually pulls from: example.com/assets/sites/#/imagename.jpg, where subsitename, #, and imagename.jpg are all variables.
It seems like this should be really simple, but I'm having a hard time finding the right syntax or an example of someone else who has solved this issue. Does anyone know the proper RewriteRule I would add?
My current .htaccess file contains this:
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
RewriteRule . index.php [L]
Try this instead:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
# uploaded files
RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]
# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^[_0-9a-zA-Z-]+/(wp-(content|admin|includes).*) $1 [L]
RewriteRule ^[_0-9a-zA-Z-]+/(.*\.php)$ $1 [L]
RewriteRule . index.php [L]
</IfModule>
# END WordPress

Resources