Solved

.htaccess redirect to index.php

Posted on 2009-06-29
6
1,735 Views
Last Modified: 2013-12-13
Trying to install lilurl, an open source clone of tinyurl. onto a ubuntu box.  I have mysql 5, php5, and apache 2 installed, and configured.  I have installed the lilurl to the proper location, and have followed the instructions thusfar.

I need to set up .htaccess to redirect the normal apache 'it works' page to the lilurl index.php page which is in
/etc/lilurl

How do I do this?

I've turned on the AllowRewrite in the apache.conf file, and have the following in the .htaccess file.


#Options +FollowSymlinks
#RewriteEngine on
#rewritecond %{http_host} ^domain.com [nc]
#rewriterule ^(.*)$ http://174.129.83.52/$1 [r=301,nc]
#rewriterule ^(.*)$ http://www.domain.com/$1 [r=301,nc]

#RewriteEngine On
#RewriteRule (.*) /etc/lilurl/index.php

Have tried the above, but continue to get the "it works" default apache2 page, even after clearing cache and what not.

This is the README.txt file.

 

lilURL 0.1.1 http://lilurl.sourceforge.net

 

lilURL is a simple PHP/MySQL app that works basically like tinyurl.com,

allowing you to create shortcuts on your own server.

 

-----------------------------------------------------------------------

 

To install:

 

1. Create a MySQL database and user for lilURL.

 

2. Import the lilurl.sql file:

 

      (( like so:

 

         mysql -u <lilurl_user> -p <lilurl_db> < lilurl.sql

 

      ))

 

3. Edit the configuration file includes/conf.php to suit your needs.

 

4. Set up mod_rewrite, if necessary

 

      (( a .htaccess file with the lines:

 

         RewriteEngine On

         RewriteRule (.*) index.php

 

        should suffice ))

 

5. Buy 15 donuts and eat them all in one sitting.

Open in new window

0
Comment
Question by:Illyankesh
  • 4
  • 2
6 Comments
 
LVL 17

Expert Comment

by:jasonsbytes
ID: 24738834
do you actually have the #'s at the beginning of each line?  If so remove them.
0
 

Author Comment

by:Illyankesh
ID: 24739125
Heh, no I had commented them all out, because they were not working.  I have tried them uncommented.
0
 

Author Comment

by:Illyankesh
ID: 24739137
The page I'm trying to get apache to go to is in /etc/lilurl  there is a an index.php page.

But the apache is defaulting to the 'it works' page in /var/www

I've installed libapache2-mod-php5 and I know that is working as well.

0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 17

Accepted Solution

by:
jasonsbytes earned 500 total points
ID: 24739262
create a soft link to the /etc/lilurl/index.php file in your /var/www/ and then rewrite it to the soft link.

ln -s /etc/lilurl/index.php /var/www/index.php
0
 

Author Comment

by:Illyankesh
ID: 24739566
Did that

I'm entering the ip address http://***.***.***.***

and I'm still getting the 'itworks' default php.

I reloaded apache2, and restarted apache2, and cleared the browser cache.  No change.

0
 

Author Comment

by:Illyankesh
ID: 24739735
Got it, nevermind.  had to add the index.php to the end of the ip address.
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
The viewer will learn how to dynamically set the form action using jQuery.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now