Solved

.htaccess redirect to index.php

Posted on 2009-06-29
6
1,750 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Building an interactive eFuture classroom

Watch and learn how ATEN provided a total control system solution including seamless switching matrix switch, HDBaseT extenders, PDU, lighting control to build an interactive eFuture classroom.

Question has a verified solution.

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

Suggested Solutions

In Solr 4.0 it is possible to atomically (or partially) update individual fields in a document. This article will show the operations possible for atomic updating as well as setting up your Solr instance to be able to perform the actions. One major …
Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
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…
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.

756 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