[solved] redirection

#1
Hello
With apache I made a redirection from root domain to page.html (example.com to exmaple.com/page.html)
I create an empty file on root directory named page.html
And I add this lines to .htaccess

Code:
RewriteEngine On
DirectoryIndex page.html index.php
DirectoryIndexRedirect seeother
RewriteRule ^page.html$ index.php [L]
When I switched to LSWS the redirection stop working

On /page.html the content is showing but when going to domain root, the redirection to page.html stop working and show the empty page.html

How to fix that please !

Cheers
 
#3
A lot of thanks for the answer
The code partially correct the issue
Root page is not anymore empty, it's showing correct content
But I need to fully redirect root to /page.html (example.com to exmaple.com/page.html)
I mean that the url on browser must be exmaple.com/page.html not exmaple.com
Hope you understand me
 

Pong

Well-Known Member
Staff member
#4
Any particular reason? Any usage case? What do you want to achieve?

You may have to decide which is your index page, page.html or index.php. Otherwise, it may make the situation a little complicated without any benefit.
 

NiteWave

Administrator
#5
But I need to fully redirect root to /page.html (example.com to exmaple.com/page.html)
I mean that the url on browser must be exmaple.com/page.html not exmaple.com
can you try:

RewriteEngine On
#DirectoryIndex index.php
RewriteRule ^$ /page.html [R=301,R]
RewriteRule ^page.html$ index.php
 

NiteWave

Administrator
#7
happy to know...

but there is a typo in one line:
RewriteRule ^$ /page.html [R=301,R]
should be
RewriteRule ^$ /page.html [R=301,L]

does
RewriteRule ^$ /page.html [R=301,R]
work well ?
 
Top