[Resolved] redirection

Status
Not open for further replies.
#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
 
Last edited by a moderator:

NiteWave

Administrator
#2
following code should work:
Code:
RewriteEngine On
DirectoryIndex index.php
RewriteRule ^page.html$ index.php [L]
 
Last edited by a moderator:
#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
 
Last edited by a moderator:

Pong

Administrator
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:

Code:
RewriteEngine On
#DirectoryIndex index.php
RewriteRule ^$ /page.html [R=301,R]
RewriteRule ^page.html$ index.php
 
Last edited by a moderator:

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 ?
 
Last edited by a moderator:
Status
Not open for further replies.
Top