nixCraft Linux Forum

nixCraft

Linux / UNIX Tech Support Forum

Apache Redirect / to index.php using mod_rewrite .htaccess

This is a discussion on Apache Redirect / to index.php using mod_rewrite .htaccess within the Web servers forums, part of the Mastering Servers category; How do I redirect / to index.php? Can any one guide me for this issue - I want to redirect ...


Go Back   nixCraft Linux Forum > Mastering Servers > Web servers

Linux answers from nixCraft.


Web servers Discussion on Apache, Nginx and Lighttpd HTTP/web server and configuration issues.

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 18-04-2008, 12:24 PM
kasimani's Avatar
Senior Member
User
 
Join Date: Jul 2006
Location: India, Delhi
OS: CentOS, RedHat, Fedora, Ubuntu
Posts: 151
Thanks: 3
Thanked 1 Time in 1 Post
Rep Power: 4
kasimani is on a distinguished road
Send a message via Yahoo to kasimani
Default Apache Redirect / to index.php using mod_rewrite .htaccess

How do I redirect / to index.php? Can any one guide me for this issue - I want to redirect
Code:
sasa.com to sasa.com/index.php
Thanks In Advance

Last edited by root; 18-04-2008 at 11:21 PM. Reason: fixed bad english
Reply With Quote
  #2 (permalink)  
Old 18-04-2008, 11:17 PM
rockdalinux's Avatar
Is that all you got?
User
 
Join Date: May 2005
Location: Planet Vegeta
OS: Redhat
Posts: 708
Thanks: 15
Thanked 19 Times in 18 Posts
Rep Power: 10
rockdalinux is a glorious beacon of light rockdalinux is a glorious beacon of light rockdalinux is a glorious beacon of light rockdalinux is a glorious beacon of light rockdalinux is a glorious beacon of light rockdalinux is a glorious beacon of light
Default

Put something as follows in your httpd.conf or .htaccess file:
Code:
 RedirectMatch ^/$ /index.php
__________________
Rocky Jr.
What's wrong? I hope I am not making you uncomfortable...

Never send a boy to do a mans job.
Reply With Quote
  #3 (permalink)  
Old 14-01-2010, 08:03 PM
Junior Member
User
 
Join Date: Oct 2009
OS: OpenSuse
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
guif is on a distinguished road
Default Apache Redirect to different contexts with mod_rewrite

How do I redirect to different cotexts with this module??

I have this:

Code:
<IfModule mod_rewrite.c>
        RewriteEngine On
        RewriteCond  %{SERVER_PORT} !^4443$
        RewriteRule ^(.*)$ https://127.0.0.1:4443/cotnext1 [L,R]
</IfModule>
By default if I put 127.0.0.1 in my browser automatic redirect to: https://127.0.0.1:4443/cotnext1

so, if i would like to go to another context what can i do?
For example, if I put context2 my Apache likes redirect to https://127.0.0.1:4443/cotnext2
Reply With Quote
  #4 (permalink)  
Old 30-01-2010, 12:37 AM
Junior Member
User
 
Join Date: Jan 2010
OS: Debian
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
santoshkpt is on a distinguished road
Default From Santosh P

Put below as it is in ur httpd.conf

Code:
<IfModule mod_rewrite.c>
        RewriteEngine On
        RewriteCond  %{SERVER_PORT} !^4443$
        RewriteRule ^(.*)$ https://127.0.0.1:4443/cotnext2 [L,R]
</IfModule>
Quote:
Originally Posted by guif View Post
How do I redirect to different cotexts with this module??

I have this:

Code:
<IfModule mod_rewrite.c>
        RewriteEngine On
        RewriteCond  %{SERVER_PORT} !^4443$
        RewriteRule ^(.*)$ https://127.0.0.1:4443/cotnext1 [L,R]
</IfModule>
By default if I put 127.0.0.1 in my browser automatic redirect to: https://127.0.0.1:4443/cotnext1

so, if i would like to go to another context what can i do?
For example, if I put context2 my Apache likes redirect to https://127.0.0.1:4443/cotnext2

Last edited by nixcraft; 30-01-2010 at 07:55 AM. Reason: code tags
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads

Thread Thread Starter Forum Replies Last Post
redirect to www in lighttpd muks Web servers 11 02-06-2007 10:55 PM
confused with mod_rewrite kasimani Coding in General 0 20-01-2007 01:46 PM
mod_rewrite in apache: rewritecond kasimani Web servers 0 19-01-2007 11:19 AM
How to redirect Output puppen Shell scripting 15 06-12-2006 08:44 PM
.htaccess problems rcordeiro Linux software 4 05-07-2006 07:32 PM


All times are GMT +5.5. The time now is 05:13 PM.


Powered by vBulletin® Version 3.8.5 - Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2
©2005-2010 nixCraft. All rights reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38