I have a website that lives within a folder one level off the root of the website. This was done because it used to host multiple web applications, but the other application has been retired and now the domain is used for just the site. We want to move it out of the folder and into the root of the domain
Current: website.com/main/page.php
Want: website.com/page.php
The issue is all the links that are out there that have the old location. I would like to have a .config file that lives in the old directory and have it re-direct to the link by just removing "main" from the URL. What is the best way to go about doing this?
One way of doing this is by using HTTP redirect
This method is explained in this video: https://www.youtube.com/watch?v=wC3kJnhlofw
Related
Is it possible for an application within a website to have its own robots.txt file?
For example, I have a site running under http://www.example.com and this has its robots.txt file.
We then have a seperate site running as an application under this domain: http://www.example.com/website-app
Is it possible to keep the robots.txt file seperate for the application or do I need to put all the stuff for the application into the main root robots.txt?
The robots.txt file needs to reside in /robots.txt, there is no way to tell the crawler that it can be found anywhere else (like for favicons for example). So if you can you should add this to your root robots.txt (or put your application on a subdomain instead where it can have its own file).
If you want to control specific pages individually you can use <meta>-tags instead, as described at robotstxt.org. Since this needs to be put on every page it will have the crawler visit (but not index) at least one page, but it won't follow to other pages (unless you tell it to). For a small application in a subdirectory this might be an ok solution.
I've taken on the webmaster role for a website that uses DNN version 07.02.02. Most of the links to my pdf files are broken. They pdfs were in a folder called "/pdfs" now they're in a new folder "/docs/pdfs "
A few quick things:
I only have ftp access to the web site files. No access to web.config so rewrite rules are out.
I don't want to copy the old files back to "/pdfs" because it would mean managing two different pdf copies (there are over 500 pdfs).
Using file directories with a .pdf extension then add an index.asp file with a redirect i.e. "/pdfs/file_1001.pdf/index.asp" led to an error page because there's an override which doesn't allow site directory pages exposed.
Using a DNN module where I'd have to enter 500 files to redirect seems redundant when I only want to move a directory.
Any solutions to try?
In DNN if you have HOST level access you can modify Config files through the Host/Configuration manager page.
There you could modify the web.config file.
You might also look at the siteurls.config file (also accessible there) in which you could define some URL rules, might be as easy as
<RewriterRule>
<LookFor>/pdf/(.*)</LookFor>
<SendTo>/docs/pdf/$1</SendTo>
</RewriterRule>
The above rule is completely untested, not positive if it will do what you need or not.
I did a little more testing, and it looks like this won't work out of the box as a default setting that tells it to NOT rewrite PDF files, but I can't find the source code for that currently.
The root of the site http://example.com correctly identifies index.html and renders it. In a similar manner, I want, http://example.com/foo to fetch foo.html present in the root of the directory. The site that uses this functionality is www.zachholman.com. I've seen his code in Github. But still I'm not able to find how it is done. Please help.
This feature is actually available in Jekyll. Just add the following line to your _config.yml:
permalink: pretty
This will enable links to posts and pages without .html extension, e.g.
/about/ instead of /about.html
/YYYY/MM/DD/my-first-post/ instead of YYYY-MM-DD-my-first-post.html
However, you lose the ability to customize permalinks... and the trailing slash is pretty ugly.
Edit: The trailing slash seems to be there by design
It's actually the server that needs adjusting, not jekyll. Be default, jekyll is going to produces files with .html extensions. There may be a way around that, but it's unlikely that you really want to do go that route. Instead, you need to let your web server know that you want those files served when a URL is called with the file's basename (and no extension).
If your site is served via an Apache web server you can enable the "MultiViews" option. In most cases, you can do that be creating an .htaccess file at your site root with the following line:
Options +MultiViews
With this option enabled, when Apache receives a request for:
http://example.com/foo
It will serve the file:
/foo.html
Note that the Apache server must be setup to allow the option to be set in the htaccess file. If not, you would need to do it in the Apache config file itself. If your site is hosted on another web server, you'll need to look for an equivalent setting.
So, I have a problem and I have been searching forever about how to do this.
I want to have several project directories on my shared host but I want to be able to hit the public directory when someone types in the root directory for that project. I can't edit the httpd.conf to set up virtual hosts so I have been looking for alternative solutions.
Account Structure
/public_html
.../Project1
....../application
....../public
I stumbled on http://www.mauriciocuenca.com/blog/2009/03/two-or-more-zend-framework-projects-on-a-shared-host/ and followed the steps (modifying some stuff since it is outdated)
And I can get a single view to show up. The problem is, if I create a layout I can't get anything but the normal view to display. I think I am just missing a simple hook up.
Is the above solution the best for my situation?
You problem is not 100% clear, I can't figure out that you want to serve one site per shared host directory or all site from the same directory.
Although you can't edit httpd.conf, you can use .htaccess file. While using Zend you already use .htaccess (located in public dir). So you can write rules to make url based redirections.
I am building an Iphone Magazine App . I need the app to access a secured web folder/directory hosted on probably Apache or IIS to download pdf mag files inside the HTTP folder .
Is the conventional way of doing this by using the .htaccess to create a password protected folder for Apache ? How about IIS ?
And a conventional way for the Iphone App to access the folder ? Any Xcode example ?
Thanks .
Well, the conventional way would not be to expose the directory, using mod-autoindex (Apache). The directory should actually be outside the server root, to give it some semblance of protection.
Then you would write a small CGI (PHP, java servlet, ruby, etc), which enforces some sort of client-authentication scheme, and only then would it give you a nice list of what is in that directory. It could also be responsible for sending the download stream to a particular pdf. Only this script would have permission to view what's inside that directory.
So that's certainly not exhaustive as it pertains to security, but it should point you in the right direction. It really depends on how secure you need this directory.
Xcode (Cocoa) can easily access any remote URL information, regardless of the approach you take. Check out NSURLConnection and this guide:
http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/URLLoadingSystem/URLLoadingSystem.html