| |||||||||||
Redirects same site Posted by TedH (TedH), 10 August 2007 Hi Graham, trust you're well.Not sure what to use here. I think I need to use a 302 redirect. Server: Apache Web Server 1.3 Object is to redirect, temporarily, all the pages in my /public_html directory to a single page in the same directory. This is for updating an entire site. When done the .htaccess will be removed. Is this possible? Code:
Or to another directory: Code:
? I know I can use .htaccess for this by listing each page, just wondered if there was an easier way. Hope you can help, thanks - Ted Posted by admin (Graham Ellis), 11 August 2007 Personally I would use mod_rewrite, as this ensures that page is served in a single request and the name is preserved. Could make a difference in search engine placementsSomething like ... RewriteEngine On Rewrite *.html tempname.html ... in your .htaccess, but I am away at the moment and have writen that from memory Posted by TedH (TedH), 11 August 2007 I'll check that out, thanks GrahamPosted by TedH (TedH), 11 August 2007 Graham, got it sorted (w/help from my tech suppt and server forum as well). Thought you'd like to see the solution.Code:
By having an "update page" in the web folder, an .htaccess with the above code in will redirect to that page. This happens with all sub-directories as well. This works on my live server, but am not sure if it will work on all Apache servers (?) - I don't know if this sort of stuff is like Perl (101 ways to do the same thing). Cheers - Ted Posted by admin (Graham Ellis), 12 August 2007 The two things this depends on are(1) Is mod_rewrite loaded and (2) Does the main httpd.conf file allow for .htaccess overrides. Posted by TedH (TedH), 14 August 2007 Thanks Graham, trust you got back okay (easily) Posted by admin (Graham Ellis), 14 August 2007 Still away, Ted ... posting from New York state!This page is a thread posted to the opentalk forum
at www.opentalk.org.uk and
archived here for reference. To jump to the archive index please
follow this link.
|
| ||||||||||
PH: 01144 1225 708225 • FAX: 01144 1225 793803 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho |