Solved

.htaccess redirect to index.php

Posted on 2009-06-29
6
1,738 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
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You ever wonder how to backup Linux system files just like Windows System Restore?  Well you can use Timeshift in Linux to perform those similar action.  This tutorial will show you how to backup your system files and keep regular intervals. Note…
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

910 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

19 Experts available now in Live!

Get 1:1 Help Now