Solved

.htaccess redirect to index.php

Posted on 2009-06-29
6
1,743 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
VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

 
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

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

This article will explain how to establish a SSH connection to Ubuntu through the firewall and using a different port other then 22. I have set up a Ubuntu virtual machine in Virtualbox and I am running a Windows 7 workstation. From the Ubuntu vi…
Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

778 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