I had MediaWiki installed in as the default site on my server using IIS 6 and I created a virtual directory and pointed it to the Wiki folder. The page loads, but all the links are pointing to the original location that is no longer pointing to the Wiki Folder.
Info
Server Name: tech
Path to Wiki: http://tech/wiki/
Example
Links
Wrong Link - This is the current link displayed
http://tech/index.php?title=Main_Page
The link should look like this
http://tech/wiki/index.php?title=Main_Page
All of the links are not showing the /wiki
Any ideas?
Do you have this in your local settings?
$wgArticlePath = "/wiki/$1"; # Virtual path. This directory MUST be different from the one used in $wgScriptPath
$wgUsePathInfo = true; # Enable use of pretty URLs
Try setting
wgUsePathInfo = false;
Related
I just published my web app which has the following structure:
Project Name
StylesFolder
filename.css
anotherfile.css
JavaScriptFolder
bootstrap.js
Index.html
What I did was:
Adding a new WebSite in the server IIS with the path were I publish my WebApp (ex. C:\WebProjects\PublishedApp\Project Portal)
Selecting my published app and converting into an application (The alias name was Project Name and the physical path was C:\WebProjects\PublishedApp\Project Portal\Project Name)
The problem is when I try to see the website. I'm able to enter to 192.169.100.20:80/Project%Name/ and my index page is loaded (I can see the text, inputs, etc.) but I cannot see any stlye and javascript input and when I check the console logs all the files are getting a 404 error response.
When I check which URL is used by the files I can see that they are trying to get accessed by 192.169.100.20:80/Project Name/StylesFolder/filename.css etc...
So my question is what can I do to remove the /Project%Name/ string from the URL?
PD. I'm using IIS 7
When you add your website in IIS, select the application folder you published. For example, when you publish your application to D:\Program Files\Publish Folder, select the Publish Folder folder directly when adding the website and choose the physical path.
This is the reference:Deploy Website on IIS
I installed Joomla in peterrisman.com/PilotMarketingStrategy-J/
I successfully built a new website
So far, so good.
I pointed pilotmarketingstrategy.com to peterrisman.com/PilotMarketingStrategy-J/
I updated .htaccess with RewriteBase /
I updated configuration.php with public $live_site = 'http:// pilotmarketingstrategy.com'
Viola! the site is live... BUT
I can't log into the admin from pilotmarketingstrategy.com/admin/index.php - it doesn't recognize my ID or p/w.
In order for me to log into the admin, I have to change configuration.php back to public $live_site = 'http:// peterrisman.com/PilotMarketingStrategy-J/'. When I'm finished, I have to change back to public $live_site = 'http:// pilotmarketingstrategy.com'
This CAN'T be right. Does anyone know how to properly configure Joomla so that both the live site and admin share the same domain?
Try setting the live_site parameter to null so the line in your configuration.php file should look like this:
public $live_site = '';
Recent Joomla installs rarely need this parameter to be set.
Here is a great answer how the paramter live_site works. Maybe this gives you the answer for your Problem.
I'm running self hosted Nancy web application on Owin and have troubles with static content.
Let's say my application runs from this folder:
c:/myfolder/
My Views are in here:
c:/myfolder/Manager/Views/
so in my browser I can go to http://localhost:85/Manager and my page loads.
I simply can't make it to serve static content though, all my files are in /Content folder, I tried to place it both to /myfolder and /Manager folder with no luck.
Neither http://localhost:85/Manager/Content/css/styles.css nor http://localhost:85/Content/css/styles.css urls work
How do I get it to work?
Fixed the problem by adding these lines of code to Startup :
using Microsoft.Owin.FileSystems;
using Microsoft.Owin.StaticFiles;
...
var options = new FileServerOptions()
{
RequestPath = PathString.Empty,
FileSystem = new PhysicalFileSystem("/Path/here")
};
app.UseFileServer(options);
I wrote this little web app that lists the websites running on the local IIS + virtual directories attached to the websites.
Using the following line I was able to get the HTTP Redirection URL of a virtual directory, if it was set to redirect:
_directoryEntry.Properties["HttpRedirect"].Value.toString()
Which works quite nicely in IIS 6 - but the value is empty when I try my app in an IIS 7 - and I tried switching the application pool to Classic pipeline as well - what has changed in IIS 7 here? And why?
In IIS7 <httpRedirect> element replaces the IIS 6.0 HttpRedirect metabase property.
You need to set it up like this in your web.config file:
<system.webServer>
<httpRedirect enabled="true" destination="WebSite/myDir/default.aspx" />"
</system.webServer>
If you do not want to tweak web.config, this article talks about a way to do them the IIS 6 way: Creating Http Redirects in IIS7 on Virtual Directories like IIS6
Hope this helps.
What has changed?: IIS7 has a completely new configuration system similar to .NET's hierarchical configuration system. Checkout this link for more detail here on what's changed.
How to get the HttpRedirect value: In C#, rather than using the System.DirectoryServices namespace to access the IIS configuration settings, use the new Microsoft.Web.Administration.dll.
Your code should look something like this example from IIS.net:
using System;
using System.Text;
using Microsoft.Web.Administration;
internal static class Sample
{
private static void Main()
{
using (ServerManager serverManager = new ServerManager())
{
Configuration config = serverManager.GetWebConfiguration("Default Web Site");
ConfigurationSection httpRedirectSection = config.GetSection("system.webServer/httpRedirect");
Console.WriteLine("Redirect is {0}.", httpRedirectSection["enabled"].Equals("true") ? "enabled" : "disabled");
}
}
}
You can actually do quite a lot with the new Microsoft.Web.Administration.dll. Checkout Carlos Ag's blog here for some ideas.
Two quick notes:
Microsoft.Web.Administration.dll is available if the "IIS Management Scripts and Tools" role service is installed. It should be under the inetsrv directory in systemroot.
Any code you run with the MWA dll needs to run as Administrator to access IIS configuration, so just make sure the account running the script has admin rights.
Hope this helps!
Im working on a Drupal installation where the setup in my local testing server is different from online server.
On my local server drupal is installed in /var/www/my_drupal and the base_path is set to /mydrupal but on the online server its installed on the root of the site, usually /public_html/
So my problem is I wanted to set a base_path and base_url variable depending on the server i am on. Where do i place my codes so that it's accessible site-wide.?
Thanks!
Luckily Drupal already has taken care of this for you
See the api site for a full listing
Of particular interest to you should be:
$base_path developer/globals.php The base path of the drupal installation. At least will default to /.
$base_url developer/globals.php The base URL of the drupal installation.
I would set it in your settings file in sites/default/settings.php just use an if statement to detect whether it is the local or live site ur on and then set the variables accordingly.
if ($_SERVER['SERVER_NAME'] == 'localhost') {
// the script is running on the local
} else {
// it is on remote
}