Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

mod rewrite

Status
Not open for further replies.
Rather than using mod_rewrite, why not just use DirectoryIndex to set index.php as the default page for that diretory of that site?

Something along the lines of:

<VirtualHost *:80
Server DocumentRoot /path/to/home/directory
.
.
.

<Directory /path/to/home/directory>
DirectoryIndex index.php
</Directory>
</VirtualHost>



Want the best answers? Ask the best questions!

TANSTAAFL!!
 
the reason is that someone has hijacked my homepage by using a 302 redirect to my and goole has indexed my home page as
I am trying to get round this problem and keep all my rankings and google page rank



Easyinkz Printer cartridges
 
Ooops.

This line:

RewriteRule ^/$ /index.php [R=302]

Should have read:

RewriteRule ^/$ /index.php [R=30[red]1[/red]]


On my machine, the testing VirtualHost configuration reads:

<VirtualHost *:80>
ServerName linuxdev.fu
DocumentRoot /home/sites/test/html

RewriteEngine on
RewriteRule ^/$ /index.php [R=301]
</VirtualHost>

A telnet converstation reads:

GET / HTTP/1.1
Host: linuxdev.fu

HTTP/1.1 301 Moved Permanently
Date: Fri, 11 Mar 2005 21:08:10 GMT
Server: Apache/2.0.53 (Unix)
Location: Content-Length: 309
Connection: close
Content-Type: text/html; charset=iso-8859-1

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>301 Moved Permanently</title>
</head><body>
<h1>Moved Permanently</h1>
<p>The document has moved <a href="<hr>
<address>Apache/2.0.53 (Unix) Server at .... Port 80</address>
</body></html>
Connection closed by foreign host.



Want the best answers? Ask the best questions!

TANSTAAFL!!
 
its working now thanks

HTTP/1.1 301 Moved Permanently
Date: Fri, 11 Mar 2005 21:09:45 GMT
Server: Apache/1.3.26 (Unix) Debian GNU/Linux PHP/4.1.2
Location: Connection: close
Content-Type: text/html; charset=iso-8859-1

Easyinkz Printer cartridges
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top