Wget and Wordpress, keep last trailing slash - wordpress

I have a Wordpress based website that I scrap using wget.
I have articles under the form
http://mydomain.com/2011/01/
once scraped becomes
http://mydomain.com/2011/01.html
I found out that when I enter
http://mydomain.com/2011/01/
in the navigator, URL gets changed to
http://mydomain.com/2011/01
which is why, I think, it is considered as a file when I call wget.
I would be very grateful if someone has some clue on how to address this.

I finally managed to get to the result I wanted, in this way:
changing my permalink structure from
/%year%/%monthnum%/%postname%.html
to
/%year%/%monthnum%/%postname%/

Related

Need to Replace Old URL with New URL in Revolution Slider

We have cloned a WordPress site and replaced the urls using Velvet URLs. But the Revolution Slider images url are not replaced yet. Please let me know if any solutions are there.
Thanks in advance.
There is a option in slider settings to change the Replace URL. Please check the screenshot attahced. Hope it helps.
This will work for anybody still looking for this solution. It happened to me that I needed to change the base URL on slider revolution.
Export to PC
Unpack the zip
Open the slider_export.txt in notepad++
find and replace the URL, save and repack
Delete the slider, and import the new one. BINGO!
P.S When changing directory, remember to escape the forward slash "/"
Best regards.
For Slider Revolution 6, the feature has changed place.
You need to get the Domain Switch addon which is available on the main revolution slider page.
Simply browse to addons and look for DS (Domain Switch)
After installing, you'll be able to find/replace the url.
For those who got Revolution Slider as part of a theme and therefore don't have a purchase code.
Use a plugin like Better Search Replace to update the URLs.
Be aware that Revolution Slider escapes certain characters.
So https://example.com/
Is saved as https://example.com/
PhpMyAdmin can accomplish the same thing and you only need to edit the wp_revslider_slides table fields in the column params and layers. Be careful not to forget the escape characters used. I wish search and replace plugin would have a option for this escape setting.
Install Better Search Replace plugin and activate it.
Then search for youroldsite.com and replace with yournewsite.com then select all tables.
NOTE: Make sure that you have checked "Run as Dry run" to see number of changes occures before update the database.

.htaccess change directory image

I have this blog and I've looking around the way to change my image path but nothing really works for me.
This is the URL where my image will display:
http://localhost/blog/article1/
inside is located <img src="images/logo.jpg" />
but with this URL the server searches for:
localhost/blog/article1/images/logo.jpg
And the real URL for my image is: localhost/blog/images/logo.jpg
I've tried with a lot of options but so far none have worked for me.
Note: the blog is made in WordPress, but some articles come with code from another migration, so I probably cannot change the whole articles.
What I need is to elevate subdirectory to localhost/blog/images
Well, you might get away with redirecting all calls that end with /back/back1.gif to that directory, so it wouldn't matter where the call came from. That does mean you should not wish to call this to some other subedirectory, but I imagine you don't.
something like this (guessing here, cann't test, so read up on the rwriting there :)
RewriteRule ^(.*)/images/$(.*) http://test.example.com/back/$2 [L,R=301]
basically you are rewriting everything that has '/images/' in it to that static adress, pasting whatever was after images after the new asdress (the $2 thingy) and then indicating that this is the last command to parse (to stop strange things in the htaccess) and that you want a 301 (permanently moved) code to be sent.

Code needed for htaccess redirect in WordPress

I've been fixing a strange htaccess issue on my client's WP sites. I found a solution by putting the ReWrite code in the htaccess of each site and then adding a custom permalink code in permalinks and it seems to work EXCEPT for one section.
There are a total of 9 sites with this issue. All of them have a highlights plugin on the front page that's pulling story and images and displaying them on the home page and then a link that goes to the story full page. For my above permalink fix, out of the 9 sites, my fix works on 5 of them but on 4 of them in the highlights section, when you click a link I'm getting a 404.
The strange thing is, with my above fix, the highlight page still publishes, but not with my fix. For example, when you click the "fixed" link it should open as:
mysite.com/central/index.php/highlights/my-page
...but I get a 404. But all I have to do is delete the "index.php" in the above, and the page itself still works:
mysite.com/central/highlights/my-page
So what I now will do is write re-write code and put it in the root htaccess file so that when the page:
mysite.com/central/index.php/highlights/my-page
...is called it will re-write to:
mysite.com/central/highlights/my-page
...and that should fix this pesky issue. Here's the catch - I'm not good at writing code and I used my own hosting company's re-write generator to create a sample for me to see but I can't use it to generate what I need because it only generates for my domain. Since I don't know how to post code to this forum, below is a snap shot of it:
http://designerandpublisher.com/images/rewite-code.jpg
Is there a place where I can just copy and paste the URLs and it will generate the code so it looks like the above snap shot? Or is there some kind of tutorial of what / and \ and dollar signs and the periods and why they're there? I used to set up redirect code a lot simpler than this but it seems more complex now and i'm just hoping there's some kind of generator? Thanks for any assistance.
Adding the following rule should work:
RewriteRule ^central/index.php/(.*) /central/$1 [R=302]
it should turn mysite.com/central/index.php/highlights/my-page to mysite.com/central/highlights/my-page
(Change R=302 to R=301 when you are sure the redirect works)

Is there a tool to check CSS url files exist?

I've just been tasked with migrating a website from a Windows server to a Linux server.
One of the issues I've noticed straight away is that there are a number of CSS url() definitions that don't work because the case in the CSS is not the same as the actual file.
eg:
background: url(myFile.jpg);
while on the server the file is actually MyFile.jpg.
Does anyone know of a simple tool or browser plugin I can use just to scan the CSS file and verify that the url() declarations exist so that I can easily find and fix them?
The site is quite large, so I don't want to have to navigate through the pages to find 404 errors if I can avoid it.
Use Developer Tools in Google Chrome or Firebug in Firefox.
When you load HTML page with that CSS, it will show any missing resources in Network tab.
EDIT
I guess there is no any tool that will
Scan through CSS file for all the URLs
Check whether each URL exists or not.
But you can try following two links for these two tasks.
RegEx to get the URLs from CSS : With this you will have all list of URLs used in CSS
Check if a URL exists or not with cURL : An example in PHP was given.
You can still search for these two items separately and try fixing the issues.
Let me know if this helps.
What, if you simply write a http request into browser's URL bar pointing directly to the image and/or css?
How about firebug in firefox? It would give you all 404 in its console.
download
You can install Firebug if you're using Firefox or you can press F12 if you're using Chrome.. i think that goes the same with IE.. From there you will be able to check the URL and even view it in a new tab.
Turns out that the W3c Link Checker also scans CSS files which is very handy.
Had this have not worked I would have had to put together something like Vanga's solution.
Here's how I would approach this.
Make sure all image requests are handled by a (PHP) script, by adding the following to my .htaccess
RewriteRule .(?:jpe?g|gif|png|bmp)$ /images.php [NC,L]
Use file_exists() to check if the file exists, maybe even try if a lowercase version of the file exists.
Log missing files into a database table or text file.
Use a script to loop through the website's sitemap with curl to get a complete list of requested filenames that resulted in a 404.

Base URL wrongly given in Wordpress

Ive entered the base URL wrongly in the backend and now everything loads bad. Ive tried to change it again in the backend but because the URL ist wrong, the backend also looks messed up. Is there any file where I can change it directly with a text editor? Thanks!
This has worked for me in the past: http://codex.wordpress.org/Changing_The_Site_URL

Resources