redirect page
am 30.10.2007 11:00:59 von deggs
hi,
i have a page ;
www.mydomain.com/pages/page.html
i want people to be able to go to :
www.mydomain.com/page
and get the pages/page.html page.
how can i do this?
i've been messing with redirect and come up with the following, but it
doesn't work :-(
redirectMatch page pages/page\.html
thanks
Re: redirect page
am 30.10.2007 11:09:55 von clbr
On Oct 30, 10:00 am, deggs wrote:
> hi,
>
> i have a page ;
>
> www.mydomain.com/pages/page.html
>
> i want people to be able to go to :
>
> www.mydomain.com/page
>
> and get the pages/page.html page.
>
> how can i do this?
>
> i've been messing with redirect and come up with the following, but it
> doesn't work :-(
>
> redirectMatch page pages/page\.html
>
> thanks
RewriteRule ^page$ /pages/page.html [L]
Hope that help
Re: redirect page
am 30.10.2007 11:31:44 von deggs
On Oct 30, 10:09 am, clbr wrote:
> On Oct 30, 10:00 am, deggs wrote:
>
>
>
> > hi,
>
> > i have a page ;
>
> >www.mydomain.com/pages/page.html
>
> > i want people to be able to go to :
>
> >www.mydomain.com/page
>
> > and get the pages/page.html page.
>
> > how can i do this?
>
> > i've been messing with redirect and come up with the following, but it
> > doesn't work :-(
>
> > redirectMatch page pages/page\.html
>
> > thanks
>
> RewriteRule ^page$ /pages/page.html [L]
>
> Hope that help
hi, thanks for the response. does www.mydomain.com/page have to exist
for this to work? if so, just touch a file or something for it? also,
do i have to restart apache after putting the rewrite in .htaccess?
Re: redirect page
am 30.10.2007 12:16:24 von clbr
On Oct 30, 10:31 am, deggs wrote:
> On Oct 30, 10:09 am, clbr wrote:
>
>
>
> > On Oct 30, 10:00 am, deggs wrote:
>
> > > hi,
>
> > > i have a page ;
>
> > >www.mydomain.com/pages/page.html
>
> > > i want people to be able to go to :
>
> > >www.mydomain.com/page
>
> > > and get the pages/page.html page.
>
> > > how can i do this?
>
> > > i've been messing with redirect and come up with the following, but it
> > > doesn't work :-(
>
> > > redirectMatch page pages/page\.html
>
> > > thanks
>
> > RewriteRule ^page$ /pages/page.html [L]
>
> > Hope that help
>
> hi, thanks for the response. doeswww.mydomain.com/pagehave to exist
> for this to work? if so, just touch a file or something for it? also,
> do i have to restart apache after putting the rewrite in .htaccess?
1. page folder doesn't need to exist
2. You don't need to restart apache
3. Check in your .htaccess if you have there RewriteEngine on if not
put it in before RewriteRule
Re: redirect page
am 30.10.2007 12:38:13 von clbr
On Oct 30, 10:31 am, deggs wrote:
> On Oct 30, 10:09 am, clbr wrote:
>
>
>
> > On Oct 30, 10:00 am, deggs wrote:
>
> > > hi,
>
> > > i have a page ;
>
> > >www.mydomain.com/pages/page.html
>
> > > i want people to be able to go to :
>
> > >www.mydomain.com/page
>
> > > and get the pages/page.html page.
>
> > > how can i do this?
>
> > > i've been messing with redirect and come up with the following, but it
> > > doesn't work :-(
>
> > > redirectMatch page pages/page\.html
>
> > > thanks
>
> > RewriteRule ^page$ /pages/page.html [L]
>
> > Hope that help
>
> hi, thanks for the response. doeswww.mydomain.com/pagehave to exist
> for this to work? if so, just touch a file or something for it? also,
> do i have to restart apache after putting the rewrite in .htaccess?
Folder 'page' doesn't need to exist. Dont need to restart apache. Make
sure you have 'RewriteEngine on' before RewriteRule
Re: redirect page
am 30.10.2007 12:53:30 von deggs
On Oct 30, 11:38 am, clbr wrote:
> On Oct 30, 10:31 am, deggs wrote:
>
>
>
> > On Oct 30, 10:09 am, clbr wrote:
>
> > > On Oct 30, 10:00 am, deggs wrote:
>
> > > > hi,
>
> > > > i have a page ;
>
> > > >www.mydomain.com/pages/page.html
>
> > > > i want people to be able to go to :
>
> > > >www.mydomain.com/page
>
> > > > and get the pages/page.html page.
>
> > > > how can i do this?
>
> > > > i've been messing with redirect and come up with the following, but it
> > > > doesn't work :-(
>
> > > > redirectMatch page pages/page\.html
>
> > > > thanks
>
> > > RewriteRule ^page$ /pages/page.html [L]
>
> > > Hope that help
>
> > hi, thanks for the response. doeswww.mydomain.com/pagehaveto exist
> > for this to work? if so, just touch a file or something for it? also,
> > do i have to restart apache after putting the rewrite in .htaccess?
>
> Folder 'page' doesn't need to exist. Dont need to restart apache. Make
> sure you have 'RewriteEngine on' before RewriteRule
hi,
i have the following in .htaccess:
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^mydomain.co.uk [NC]
RewriteRule ^(.*)$ http://www.mydomain.com/$1 [L,R=301]
RewriteRule ^page$ /pages/page.php [L]
but when i go to http://www.mydomain.com/page it just loads a blank
page, it doens't take me to page.php
sorry, i'm trying to direct to a php script, rather than another html
page, should have made that clearer before
Re: redirect page
am 30.10.2007 13:26:09 von clbr
On Oct 30, 11:53 am, deggs wrote:
> On Oct 30, 11:38 am, clbr wrote:
>
>
>
> > On Oct 30, 10:31 am, deggs wrote:
>
> > > On Oct 30, 10:09 am, clbr wrote:
>
> > > > On Oct 30, 10:00 am, deggs wrote:
>
> > > > > hi,
>
> > > > > i have a page ;
>
> > > > >www.mydomain.com/pages/page.html
>
> > > > > i want people to be able to go to :
>
> > > > >www.mydomain.com/page
>
> > > > > and get the pages/page.html page.
>
> > > > > how can i do this?
>
> > > > > i've been messing with redirect and come up with the following, but it
> > > > > doesn't work :-(
>
> > > > > redirectMatch page pages/page\.html
>
> > > > > thanks
>
> > > > RewriteRule ^page$ /pages/page.html [L]
>
> > > > Hope that help
>
> > > hi, thanks for the response. doeswww.mydomain.com/pagehavetoexist
> > > for this to work? if so, just touch a file or something for it? also,
> > > do i have to restart apache after putting the rewrite in .htaccess?
>
> > Folder 'page' doesn't need to exist. Dont need to restart apache. Make
> > sure you have 'RewriteEngine on' before RewriteRule
>
> hi,
>
> i have the following in .htaccess:
>
> Options +FollowSymLinks
> RewriteEngine on
> RewriteCond %{HTTP_HOST} ^mydomain.co.uk [NC]
> RewriteRule ^(.*)$http://www.mydomain.com/$1[L,R=301]
> RewriteRule ^page$ /pages/page.php [L]
>
> but when i go tohttp://www.mydomain.com/pageit just loads a blank
> page, it doens't take me to page.php
>
> sorry, i'm trying to direct to a php script, rather than another html
> page, should have made that clearer before
Comment out this line for a sec RewriteRule ^(.*)$ http://www.mydomain.com/$1
[L,R=301] and check it out.
One time you have .co.uk and later .com. Are you trying to redirection
between servers?
Re: redirect page
am 30.10.2007 14:46:43 von deggs
On Oct 30, 12:26 pm, clbr wrote:
> On Oct 30, 11:53 am, deggs wrote:
>
>
>
> > On Oct 30, 11:38 am, clbr wrote:
>
> > > On Oct 30, 10:31 am, deggs wrote:
>
> > > > On Oct 30, 10:09 am, clbr wrote:
>
> > > > > On Oct 30, 10:00 am, deggs wrote:
>
> > > > > > hi,
>
> > > > > > i have a page ;
>
> > > > > >www.mydomain.com/pages/page.html
>
> > > > > > i want people to be able to go to :
>
> > > > > >www.mydomain.com/page
>
> > > > > > and get the pages/page.html page.
>
> > > > > > how can i do this?
>
> > > > > > i've been messing with redirect and come up with the following, but it
> > > > > > doesn't work :-(
>
> > > > > > redirectMatch page pages/page\.html
>
> > > > > > thanks
>
> > > > > RewriteRule ^page$ /pages/page.html [L]
>
> > > > > Hope that help
>
> > > > hi, thanks for the response. doeswww.mydomain.com/pagehavetoexist
> > > > for this to work? if so, just touch a file or something for it? also,
> > > > do i have to restart apache after putting the rewrite in .htaccess?
>
> > > Folder 'page' doesn't need to exist. Dont need to restart apache. Make
> > > sure you have 'RewriteEngine on' before RewriteRule
>
> > hi,
>
> > i have the following in .htaccess:
>
> > Options +FollowSymLinks
> > RewriteEngine on
> > RewriteCond %{HTTP_HOST} ^mydomain.co.uk [NC]
> > RewriteRule ^(.*)$http://www.mydomain.com/$1[L,R=301]
> > RewriteRule ^page$ /pages/page.php [L]
>
> > but when i go tohttp://www.mydomain.com/pageitjust loads a blank
> > page, it doens't take me to page.php
>
> > sorry, i'm trying to direct to a php script, rather than another html
> > page, should have made that clearer before
>
> Comment out this line for a sec RewriteRule ^(.*)$http://www.mydomain.com/$1
> [L,R=301] and check it out.
>
> One time you have .co.uk and later .com. Are you trying to redirection
> between servers?
hi,
i left out the line and get
The requested URL /page was not found on this server.
the other stuff already in .htaccess is trying to direct all spiders/
google etc from mydomain.co.uk to mydomain.com; tell me if this is not
correct, but i guess thats a separate question :-)
Re: redirect page
am 30.10.2007 20:08:50 von clbr
On Oct 30, 1:46 pm, deggs wrote:
> On Oct 30, 12:26 pm, clbr wrote:
>
>
>
> > On Oct 30, 11:53 am, deggs wrote:
>
> > > On Oct 30, 11:38 am, clbr wrote:
>
> > > > On Oct 30, 10:31 am, deggs wrote:
>
> > > > > On Oct 30, 10:09 am, clbr wrote:
>
> > > > > > On Oct 30, 10:00 am, deggs wrote:
>
> > > > > > > hi,
>
> > > > > > > i have a page ;
>
> > > > > > >www.mydomain.com/pages/page.html
>
> > > > > > > i want people to be able to go to :
>
> > > > > > >www.mydomain.com/page
>
> > > > > > > and get the pages/page.html page.
>
> > > > > > > how can i do this?
>
> > > > > > > i've been messing with redirect and come up with the following, but it
> > > > > > > doesn't work :-(
>
> > > > > > > redirectMatch page pages/page\.html
>
> > > > > > > thanks
>
> > > > > > RewriteRule ^page$ /pages/page.html [L]
>
> > > > > > Hope that help
>
> > > > > hi, thanks for the response. doeswww.mydomain.com/pagehavetoexist
> > > > > for this to work? if so, just touch a file or something for it? also,
> > > > > do i have to restart apache after putting the rewrite in .htaccess?
>
> > > > Folder 'page' doesn't need to exist. Dont need to restart apache. Make
> > > > sure you have 'RewriteEngine on' before RewriteRule
>
> > > hi,
>
> > > i have the following in .htaccess:
>
> > > Options +FollowSymLinks
> > > RewriteEngine on
> > > RewriteCond %{HTTP_HOST} ^mydomain.co.uk [NC]
> > > RewriteRule ^(.*)$http://www.mydomain.com/$1[L,R=301]
> > > RewriteRule ^page$ /pages/page.php [L]
>
> > > but when i go tohttp://www.mydomain.com/pageitjustloads a blank
> > > page, it doens't take me to page.php
>
> > > sorry, i'm trying to direct to a php script, rather than another html
> > > page, should have made that clearer before
>
> > Comment out this line for a sec RewriteRule ^(.*)$http://www.mydomain.com/$1
> > [L,R=301] and check it out.
>
> > One time you have .co.uk and later .com. Are you trying to redirection
> > between servers?
>
> hi,
>
> i left out the line and get
>
> The requested URL /page was not found on this server.
>
> the other stuff already in .htaccess is trying to direct all spiders/
> google etc from mydomain.co.uk to mydomain.com; tell me if this is not
> correct, but i guess thats a separate question :-)
Regarding rewriting:
IF you have a blank page redirection seems to work. There is no 404
code returned from the server. Maybe your pages/page.php output is
'nothing' or more likely you have an error in there. If so and error
reporting in php is off the as a result you will get empty page. DO
simple test:
type directly http://yourserver/pages/page.php. If blank page come up
the problem is script itself not redirection.
Re: redirect page
am 31.10.2007 12:35:18 von deggs
On Oct 30, 7:08 pm, clbr wrote:
> On Oct 30, 1:46 pm, deggs wrote:
>
>
>
> > On Oct 30, 12:26 pm, clbr wrote:
>
> > > On Oct 30, 11:53 am, deggs wrote:
>
> > > > On Oct 30, 11:38 am, clbr wrote:
>
> > > > > On Oct 30, 10:31 am, deggs wrote:
>
> > > > > > On Oct 30, 10:09 am, clbr wrote:
>
> > > > > > > On Oct 30, 10:00 am, deggs wrote:
>
> > > > > > > > hi,
>
> > > > > > > > i have a page ;
>
> > > > > > > >www.mydomain.com/pages/page.html
>
> > > > > > > > i want people to be able to go to :
>
> > > > > > > >www.mydomain.com/page
>
> > > > > > > > and get the pages/page.html page.
>
> > > > > > > > how can i do this?
>
> > > > > > > > i've been messing with redirect and come up with the following, but it
> > > > > > > > doesn't work :-(
>
> > > > > > > > redirectMatch page pages/page\.html
>
> > > > > > > > thanks
>
> > > > > > > RewriteRule ^page$ /pages/page.html [L]
>
> > > > > > > Hope that help
>
> > > > > > hi, thanks for the response. doeswww.mydomain.com/pagehavetoexist
> > > > > > for this to work? if so, just touch a file or something for it? also,
> > > > > > do i have to restart apache after putting the rewrite in .htaccess?
>
> > > > > Folder 'page' doesn't need to exist. Dont need to restart apache. Make
> > > > > sure you have 'RewriteEngine on' before RewriteRule
>
> > > > hi,
>
> > > > i have the following in .htaccess:
>
> > > > Options +FollowSymLinks
> > > > RewriteEngine on
> > > > RewriteCond %{HTTP_HOST} ^mydomain.co.uk [NC]
> > > > RewriteRule ^(.*)$http://www.mydomain.com/$1[L,R=301]
> > > > RewriteRule ^page$ /pages/page.php [L]
>
> > > > but when i go tohttp://www.mydomain.com/pageitjustloadsa blank
> > > > page, it doens't take me to page.php
>
> > > > sorry, i'm trying to direct to a php script, rather than another html
> > > > page, should have made that clearer before
>
> > > Comment out this line for a sec RewriteRule ^(.*)$http://www.mydomain.com/$1
> > > [L,R=301] and check it out.
>
> > > One time you have .co.uk and later .com. Are you trying to redirection
> > > between servers?
>
> > hi,
>
> > i left out the line and get
>
> > The requested URL /page was not found on this server.
>
> > the other stuff already in .htaccess is trying to direct all spiders/
> > google etc from mydomain.co.uk to mydomain.com; tell me if this is not
> > correct, but i guess thats a separate question :-)
>
> Regarding rewriting:
> IF you have a blank page redirection seems to work. There is no 404
> code returned from the server. Maybe your pages/page.php output is
> 'nothing' or more likely you have an error in there. If so and error
> reporting in php is off the as a result you will get empty page. DO
> simple test:
> type directlyhttp://yourserver/pages/page.php. If blank page come up
> the problem is script itself not redirection.
hi,
if i go directly to the http://mydomain.com/pages/page.php like you
said, everything is ok. it displays what it should do - the php page
is ok.
so, how come the redirect isn't working?