I'm wondering if anyone can help me, I'm running WP and I'm uploading and replacing files and SOME of the changes are there...
Then when I Inspect Element it's showing the OLD CSS. How is this happening? It's like it's caching my styles on the server for some reason?
This is my .htaccess file:
# Begin default subdomain redirect #
RewriteEngine on
RewriteCond %{HTTP_HOST} ^deadlineday.co
RewriteRule ^(.*)$ http://www.deadlineday.co/$1 [R=permanent,L]
# End default subdomain redirect #
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
Thanks in advance...
It has happened to me a couple of times. In my case, the source files have path from "cdn", so we usually purge cdn cache for changes to be reflected on the server.
Is your case similar?
Related
I have Wordpress site set up on the route of my ftp server, I am trying to add PressKit() to my site in the directory /Press . This uses an index.php file to display the html, however wordpress seems to show a 404 error when trying to access it. I have tried adding a .htaccess to the subdirectory, but with no luck.
I'm wondering how to prevent the 404 error from displaying? As I am certain the page is there, as a few times when I use the full url (including index.php) it will open, but only on my machine.
Apologies if this is simple, web dev isn't really my field.
Cheers.
Edit: Works now, but case sensitive
# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]
# Include in the next line all folders to exclude
RewriteCond %{REQUEST_URI} !(Press) [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress
Open the .htaccess file, in the root of your WordPress installation (not the sub-folder), and look for the #BEGIN WORDPRESS block. You can replace it with this
# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]
# Include in the next line all folders to exclude
RewriteCond %{REQUEST_URI} !(Press|folder2) [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress
You can add more folders for WordPress to ignore, using the pipe | where you currently see the words Press|folder2. You may also remove the "folder2" reference, that's just an example
God, this little problem drives me crazy and I really hope that you'll help me how to figure it out.
I searched over all previous threads and in the codex of wordpress, didn't find my exact problem.
This is it :
I've one host with a wordpress installed at the root. I've one domain pointing it. Everything is fine.
I've need now a second install of wordpress, that i've installed in a subfolder. I've a second domain, linked to this subdfoler.
Like this :
root > domain.net
root/subfolder > anotherdomain.net
If I let the "site url" setting and the "wordpress url" setting with "domain.net/subfolder", this is OK, I can access to my second site and all permalinks work.
But if I edit my site url/wordpress url in "anotherdomain.net" it renders the "domain.net" homepage without style...
I'm sure this is a question of HTACCESS but I can't find how to properly write it...
Thanks for your answers !
(sorry for my english, not my mother tongue)
EDIT : Here are .htaccess (at this state, I let them in order to access subfolder via domain.net/subfolder)
root:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
root/subfolder
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /subfolder
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /subfolder/index.php [L]
</IfModule>
# END WordPress
HTACCESS would be my first guess too, but another thought occurred to me: have you made sure that you are installing the two sites in two distinct SQL databases?
Assuming this is not the problem, is there any way you paste your htaccess files, so I can see if there is an issue in them?
All the config were good, the problem was with my host provider.
For the record, the htaccess for the site in the subfolder, when everything is ok :
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
And the site and wordpress urls pointing to the new domain.
Got pulled in the last second because someone made a minor tweak to a WP site of ours and removed "www." (or so I am told) from the url. Now the page can only be reached by typing in wxyz.com (example). So, I speculated it was a .htaccess write and told my friend who is attached to that project about it. He agreed to try, but handed it off to me due to time constraints.
So I looked at it- for some 3hrs. An amazingly simple little problem and clearly I am missing something.
The other developer said all he did was add:
RewriteCond %{HTTP_HOST} !^kokonut\.com$ [NC]
RewriteRule (.*) http://kokonut.com/$1 [R=301,L]
But none of my code or tweaks to his would change anything, first of all. The site wouldn't ever work.
Secondly, WP has a front end system to change the url's so after this failed I thought "well, ok, I'll just go there and say "www" in front. That broke everything, the admin panel wouldn't even work anymore!
So I had to go into wp-config.php and explicitly say:
define('WP_HOME','http://wxyz.com');
define('WP_SITEURL','http://wxyz.com');
But this was just getting back to where we started! Further, without that code up there sometimes the site just won't work whatsoever.
The current .htaccess file is as written (which is DIFFERENT than his original, apparently WP overwrote it but restoring it to how it was won't do much of anything either or so it appears to me. Honestly at this point I may be running myself in circles.):
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
How it was when I was first assigned to "fix" it:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
RewriteCond %{HTTP_HOST} !^wxyz\.com$ [NC]
RewriteRule (.*) http://wxyz.com/$1 [R=301,L]
</IfModule>
# END WordPress
So what am I missing here? Obviously he could change it from www --> nothing without a problem, why is reverting it back so arduous?
I've never worked on this site, this server or with this group before. So this is a first. I've dabbled with .htaccess but I'm not "an expert", if I were I would certainly not be in this pickle!
Any help is appreciated.
Not sure if this is the source of your issues, but one big problem is that wordpress has a routing rule (RewriteRule . /index.php [L]) and then you have a redirect rule RewriteRule (.*) http://wxyz.com/$1 [R=301,L], which is fine, except that you're redirecting after you route. External redirects must happen before the server internally routes things. Additionally, wordpress will overwrite the rules that are inbetween the # BEGIN/END WordPress comments. So if you don't want wordpress to overwrite rules that you add, you need to include them outside of that block:
<IfModule mod_rewrite.c>
RewriteCond %{HTTP_HOST} !^wxyz\.com$ [NC]
RewriteRule (.*) http://wxyz.com/$1 [R=301,L]
</IfModule>
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
My working Conrete5 site recently developed a "no input file specified" problem on ALL admin pages. The root of the problem appears to be that admin pages have an unnecessary /index.php in the URL. I.E.
www.example.com/index.php/login/do_login......
If the /index.php part is removed from the URL the page will load (though all referenced files will still have /index.php hence fail to load).
I have concrete running in a sub directory but the page urls are from root e.g.
www.example.com/concrete-page-title...
This is the .htaccess file in my root directory relaying concrete requests to the concrete sub-directory.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} !(\.|/$)
RewriteRule (.*) http://www.example.co.uk/$1/ [R=301,L]
RewriteCond %{HTTP_HOST} ^example.co.uk$
RewriteRule ^/?(.*)$ http://www.example.co.uk/$1 [R=301,L]
# redirect concrete
RewriteCond %{REQUEST_URI} !^/concrete
# permit normal access to wordpress installation
RewriteCond %{REQUEST_URI} !^/news
RewriteRule ^(.*)$ concrete/$1 [L]
</IfModule>
I have pretty urls turned on, here is the .htaccess file in my concrete sub-directory (/concrete).
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME}/index.html !-f
RewriteCond %{REQUEST_FILENAME}/index.php !-f
RewriteRule . index.php [L]
</IfModule>
Sidenote:
cgi.fix_pathinfo=1 (have changed to 0, no change)
And the site is not hosted with GoDaddy.
The sites been for a fair while now with no updates, despite my fiddling I have had no success so any suggestions greatly welcome.
Something that worked on a site where the server's PHP had been upgraded:
in config/site.php add:
define('SERVER_PATH_VARIABLE', 'REQUEST_URI');
define('DIR_REL', '');
I have been working on a website that is primarily PHP based. When a user visits the site stuff like http://robroscoe.ca/index.php, is redirected to http://robroscoe.ca and I am okay with this. What I am not okay with is, my webpages like robroscoe.ca/cv.php when you type in robroscoe.ca/cv redirecting back to robroscoe.ca. I am not sure how this happened and I am wondering if someone could explain to me what is going on.
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
I think the .htaccess file has something to do with this but I am not sure how to modify this as Wordpress seems to have created this for me without me knowing it. Any help or reading materials would be appreciated.
Thanks for your time!
You problem is that you've created a PHP script that is separate from WordPress and are trying to access it through a 'pretty' URL which WordPress handles. WordPress does not know of a page called 'cv', and handles it like any other 404.
I would strongly recommend that you create the page within WP so it can manage its own 'pretty URL' structure.
If you're hellbent on shoehorning your own scripts in, then get cozy with hand-editing your .htaccess file for each one.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^cv/?$ cv.php [L] #new rule
RewriteRule ^index\.php$ - [L] #this is made redundant by the very next line.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>