Solved

.htaccess redirect to index.php

Posted on 2009-06-29
6
1,765 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
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.

 
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

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

These days socially coordinated efforts have turned into a critical requirement for enterprises.
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

617 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