Website URL on CCGI servers
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Plusnet Community
- :
- Forum
- :
- Help with my Plusnet services
- :
- Everything else
- :
- Website URL on CCGI servers
Website URL on CCGI servers
05-02-2011 8:06 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
I've managed to set my domain and hostname to point to the CGI server such that www.eyemagine.co.uk displays the current image.html I've uploaded to the root of the server - not much point in trying it as the links on that page point to non-existent places, it's just a page to test it worked! Ultimately, I'm going to upload Wordpress.
I have uploaded some images to url www.eyemagine.co.uk/imagery. ; When I enter that URL, it changes to www.eyemagine.co.uk/~coolj/imagery. ; Is there any way to stop this? I'd prefer not to have my user name in the displayed URL on the browser.
thanks
Andrew
Re: Website URL on CCGI servers
05-02-2011 9:15 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
C:\Documents and Settings\Peter>wget http://www.eyemagine.co.uk/imagery
--21:12:11-- http://www.eyemagine.co.uk/imagery
=> `imagery'
Resolving www.eyemagine.co.uk... done.
Connecting to www.eyemagine.co.uk[84.92.1.4]:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: http://www.eyemagine.co.uk/~coolj/imagery/ [following]
--21:12:11-- http://www.eyemagine.co.uk/%7Ecoolj/imagery/
=> `index.html'
Connecting to www.eyemagine.co.uk[84.92.1.4]:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 10,543 [text/html]
100%[====================================>] 10,543 332.13K/s
21:12:11 (332.13 KB/s) - `index.html' saved [10543/10543]
You appear to have a redirect in there somewhere. Do you have a .htaccess file in imagery which may be doing a redirect?
Are you using some king of CMS (content management system) or gallery system to create the pages. If so, it may be changing the URL.
Re: Website URL on CCGI servers
05-02-2011 9:20 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
That's caused by the trailing slash problem combined with the way ccgi is configured. You'll need a .htaccess file and you can find a recipe in the message linked from section 8 of the faq above.
Gabe
Re: Website URL on CCGI servers
06-02-2011 6:18 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Sorry for not responding to your help more quickly. I checked and do not have a .htaccess file (ensuring that hidden files were being displayed.) Having understood from your responses that something was being re-written and that I'd need to actually re-rewrite (!) it, then I needed to brush up on .htaccess and rewrite rules. Rather than take the easy way out and just ask you what I should create, I've spent a little time trying to understand this...
I've come up with the following that I think will work and was hoping you might cast your eyes over it and let me know if I've understood correctly.
Because of suExec rewriting URLs with my username automatically (which is what Peter noticed) and Gabe spelt out in his post, then I need an .htaccess file to overcome it.
Here's my understanding:
www.eyemagine.co.uk/imagery/index.html is rewritten automatically to www.eyemagine.co.uk/~coolj/imagery/index.html
and so on for other resources, e.g.:
www.eyemagine.co.uk/~coolj/imagery/content/Johnson_040801_0320_large.html
I want to see in the browser, for example:
www.eyemagine.co.uk/imagery/index.html
www.eyemagine.co.uk/imagery/content/Johnson_040801_0320_large.html
that is, remove the ~coolj element.
so....
// make sure the Host is www.eyemagine.co.uk
RewriteCond %{HTTP_HOST} ^www\.eyemagine\.co\.uk$ [NC]
// make sure the resource starts with /~coolj/imagery/
RewriteCond %{REQUEST_URI} ^/~coolj/imagery/
// if the above two conditions match, then replace the part of the url that reads /~coolj/imagery/ with /imagery/[rest of URL]
RewriteRule /~coolj/imagery/(.*) /imagery/$1
It's the rewrite rule I'm not sure of. Gabe's example in his post was rewriting a request to a root url to a subdirectory so having worked out how the rule was doing it, I came up with the above.
Now a slight complication, maybe, is that I want to put Wordpress on my CGI server so that the blog appears at www.eyemagine.co.uk (i.e. at the root) but I want to maintain my images at .../imagery/. I've not checked yet, but presumably Wordpress is accessed with www.eyemagine.co.uk/index.html. ; My rules above won't affect this, so it's likely to get overwritten to www.eyemagine.co.uk/~coolj/index.html. ; I'm going to need additional rewrite rules to cope with that, which I'll do later.
Thanks for your help
Andrew
Re: Website URL on CCGI servers
06-02-2011 9:54 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Gabe
Re: Website URL on CCGI servers
06-02-2011 10:25 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
I think I get it, now you have pointed it out.
The second example has a condition that checks to see if a request to a directory is being made. The rewrite rule is looking for any characters from the beginning of the URL (at least 1) and that doesn't end with a "/" and remembers this string. Then it rewrites that remembered string it with a "/" on the end. I'm presuming that suExec hasn't rewritten anything by the time my .htaccess gets called so my rewrite will occur first and thus prevent it adding in the username and the final slash?
Andrew
Re: Website URL on CCGI servers
07-02-2011 1:48 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
David
Re: Website URL on CCGI servers
07-02-2011 8:21 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Thanks very much for all your help, appreciate it.
Regards
Andrew
Re: Website URL on CCGI servers
19-04-2011 10:53 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
I notice that Coolj's site still shows the ~username when accessed using a folder URL without a trailing slash eg www.eyemagine.co.uk/imagery .
I have also been tring to get this to work but I don't seem to be having any luck. I put this code in the top of the .htaccess
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(.+[^/])$ $1/ [R,L]
But it didn't make any difference.
Is it possible to get the combination of missing trailing slash and no ~username to work?
My site and affending URL is ccgi.jepnet.co.uk/scsc
Thanks
Re: Website URL on CCGI servers
19-04-2011 11:26 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
The problem is that within that .htaccess the URL to be matched will be an empty string so it *won't* match ^(.+[^/])$ (where at least one character must be present).
I fixed this by adding (what would be in your case) …
# Fix trailing slash problem
RewriteCond %{ENV:SCRIPT_URL} ^/~[^/]+
RewriteRule ^$ /scsc/ [R,L]
… rather than your current test.
David
Re: Website URL on CCGI servers
19-04-2011 4:21 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Quote from: BJepson Is it possible to get the combination of missing trailing slash and no ~username to work?
Yes, but
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(.+[^/])$ $1/ [R,L]
should be
RewriteBase /
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(.+[^/])$ $1/ [R,L]
and goes in the / directory.
Gabe
Re: Website URL on CCGI servers
20-04-2011 12:06 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
ErrorDocument 404 /error404.htm
RewriteEngine On
RewriteBase /
# fix the trailing slash for directorys
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(.+[^/])$ $1/ [R,L]
It is in the web root (htdocs) directory but it isn't working. I can put a rewrite in each folder to detect the incorrect format and fix it there, but I'd prefer a generic solution.
Thanks
Brian
Re: Website URL on CCGI servers
20-04-2011 12:26 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Gabe
Re: Website URL on CCGI servers
20-04-2011 4:00 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Yes the .htaccess is in the root on the ccgi server (I spend so much time using Apache on other servers I always just think of htdocs). The error document does work try http://ccgi.jepnet.co.uk/wibble .
I have set up a more sophisticated test, making the rewrite divert to another folder to see if the match and the cond are actually working, but that also didn't work.
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(.+[^/])$ vault/ [R,L]
So either the rule match or the cond aren't working, or the trailing slash module is getting called before we get here
Brian..
Re: Website URL on CCGI servers
20-04-2011 4:29 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Gabe
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Plusnet Community
- :
- Forum
- :
- Help with my Plusnet services
- :
- Everything else
- :
- Website URL on CCGI servers