If I use user interface Tools - Domain mapping (changeing last to first url)
Would result in broken images.
Based on http://codex.wordpress.org/Moving_WordPress I would assume, it makes sense to use https://interconnectit.com/products/search-and-replace-for-wordpress-databases/. My question is : Is there a better way to change domain mapping so that it does not result in broken images.
When I have changed domain before on a single site installation I have used the database find and replace method (always backup first!) and I've found this to work sufficiently for that.
If you want an alternative you could use rewrites for the old domain to point to the correct files for the images.
There has been some info posted here in regards to rewrites for a similar issue https://wordpress.stackexchange.com/questions/53873/host-wp-content-on-other-domain-much-like-a-cdn#answer-53881
Just redirect any request from the old domain for images to the correct folder. This will however require you to keep the original domain for the foreseeable future.
You can find info on all the Wordpress rewrites here http://codex.wordpress.org/htaccess
I hope this answers your question
Related
I have files in a directory, "w", and I want to have those same files accessible from a different directory.
I have a MediaWiki installation in the directory 'w', creating a short url to link to the url 'wiki'. I have the files in the 'w' directory but it can be accessed from http://example.com/wiki. I want to have a second wiki entirely with the url format of http://example.com/second-wiki.
Since MediaWiki uses the content of files from a database the code never actually needs to change, even the LocalSettings.php. I set up a database system, modified the MediaWiki system, and created multi wiki support in a single database, by using a database table with input information such as the url to use. Or even use the same files and add a localsettings.php file to a directory 'w2' but use everything else from the original directory, 'w'. Is this possible? Preferably using .htaccess, or some other equally easy to edit. I don't want any changes to php configuration though.
I believe this may help...... - it is a simple redirect done in PHP so it is easy to edit later, etc.
I'll work with the fact you have a 'w' directory accessed by http://example.com/wiki and you want to access that through http://example.com/second-wiki (where 'magic' will be done to actually open the other URL).
In the 'w2' folder, make an index.php file with the following contents:
<?php
header("Location: ../w");
// NOTE: you may need to make that w/index.php or other pointer
exit();
Now, any time you access http://example.com/second-wiki, you will actually see http://example.com/wiki
Simple and easy to change later if you need to!
Not sure from the question that this is the solution (it fits the topic and some of the question text, though the question text does 'jump around' a bit...) - if it isn't, please rephrase the question to be more clear on just what you are looking for (in one place you say "the code never actually needs to change, even the LocalSettings.php" - then in another you talk about needing separate settings.....) - however, if you are looking for the 'simplest' (IMHO) way to make multiple URLs point to the same folder, this is the way to go - pure PHP and easy to mod later!
I want to mask some of the subdirectories and pages for my website. For example:
I want to change
www.example.com/blog.php?post=post1
to
www.example.com/blog
or something similar to that. I have seen examples about redirecting and such but that doesn't seem to work for what I want and I would like to stay away from iframes if possible. I just want the address bar to not reflect my internal directory structure and page names. I want it to keep showing /blog while they are moving from post to post. Thanks.
P.S. I am not using wordpress or any other CMS or blogging system.
You can use apache mod_rewrite for that.
Mod Rewrite Generator
And if You don't want to have the same url on blog-post/article change, but to display different content, all I can think of this moment is by using either POST method or browser cookies, but, that would require a lot of page reloads, and it simply is not recommended for wide use. If You are building per_se (one person only) panel or similar, than url doesn't matter that much, but, speaking of blog..
It is quite reasonable to hide .php extension or url query index/key, but not what You would like to accomplish.
Like I said, it is possible, but Luke .. don't do that.
Blog should be bookmarkable on each and every #stop, and that happens just because of unique urls and hash values. Without these two, no hyperlinking possible *(not to mention seo penals and flaws + dozen of other unwanted obstacles, page caching for instance).
I am concerned this may not be possible (at least not easily) in Magento (1.4).
So we currently have a site set up:
shopping-public.mysite.com
Searching through core_config_data and the source code, shopping-public is referenced quite a few times.
What I want to accomplish is to have the following subdomain work on the same code base, AND have all the links between pages match up:
shopping-development.mysite.com
I have set up ServerAlias shopping-development.mysite.com in the .conf file, and it works - that is, I'm getting there, and the page is being presented.
However, it does NOT work in the sense that:
a) the references to the CSS files and JS files are still to shop-public.mysite.com, and
b) links to products and other pages are still to shop-public.mysite.com
How do I solve (a) and (b) so that, regardless of the subdomain (or even domain), asset file links and page links change relative to the (sub) domain I am on?
I am fairly new to Magento, and there are a LOT of xml values that reference this involved..
Magento have a lot of configuration.
core_data
htaccess if use apache need test rewrite rules ok or no.
and maybe hardcoded index.php with switch case?
But firstly try clean cache.
Magento will, as you can see, always attempt to redirect back to the primary domain. To achieve this, I think you'd probably be best using different store views/sites and then using .htaccess to load the specific site required.
With this approach, there would be a concern over duplicate-content in Google's eyes I'm sure.
I Just started exploring CakePHP. From what I have observed, In CakePHP, All of the following are the same.
http://example.com/page
http://example.com/page/
http://example.com/page/index
Is this not considered duplicate content by the search engines?
If yes, how to fix this?
They are only duplicate content if you link to them differently, thus making the different urls visible.
Usually, using cake's internal routing you can only get one of those three versions. Always.
But if someone would get hold of the wrong url and does link it from somewhere it might actually be followed by google and indexed wrongly. So yes, there is a possibility.
So
use htaccess to prevent the / (or vica versa) and 301 redirect to the other one
use canonical tag in your layout to always route to the correctly routed url - not matter what the full url including /index etc might currently look like).
Details and code examples:
http://www.dereuromark.de/2012/12/29/cakephp-and-seo/
I have a site complete with CMS etc all working under one domain name. It turns out for legal reasons one page on this site has to sit on a different domain name. The page is hooked into the same CMS as the rest of the site (built using codeigniter). I don't want to have to do another installation just for this page.
Is there any simple way to display just this page under a different domain name without taking it out of the current application?
Thanks a lot
You should look at either (in order):
an include()with correct php.ini configuration
a file_get_content() and printing the variable into your page
an <iframe src="yoururl"> wich would be the easy peasy but unsafe way
using the on-purprose curllibrary
using fopen() wich theorically allows distant files to be opened, but based on my experience, it's not that reliable
Look at this site, it seems rather exhaustive regarding your problem.
Try including the file
<?php include 'http://www.domain.com/url/to/file/page.html' ?>
I think what you need here is a symlink, which is something I don't know too much about. My understanding is that the path displayed to the user does not in fact have to have anything to do with where the file is actually stored, meaning you can set this up to have a completely different URL while keeping it as part of your original application.
A simpler thing is doing a redirect...it's one line of code in your .htaccess file and you're good to go.
include is a possible solution depending on the format of the remote page (ie, this won't work very well if the remote page has a full DOM structure, and you're trying to include the remote page within the DOM structure of your CMS page), however more information about that remote page would be needed to help determine if include() alone would be enough.
Regardless, if include() does, work, you must make sure allow_url_include in php.ini is enabled, as by default script execution will terminate when encoutering a remote URL include statement.