TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 07-23-2009, 08:57 PM   #1 (permalink)
how quixotic are you?
 
ETbyrne's Avatar
 
Join Date: Dec 2007
Location: Lapeer, MI
Posts: 445
Thanks: 37
ETbyrne is on a distinguished road
Terminal Mod_Rewrite Not Working

A while back I removed my xampp install and manually installed Apache and PHP 5.2.9. Since then I have not been able to get Mod_Rewrite to work.

In httpd.conf I uncommented

Code:
LoadModule rewrite_module modules/mod_rewrite.so
but it still won't work. Am I missing something?
__________________
Dingo Web Systems > http://www.dingocode.com
My Website > http://www.evanbot.com
ETbyrne is offline  
Reply With Quote
Old 07-24-2009, 02:04 PM   #2 (permalink)
Moderateur
RegEx Guru PHP Guru Top Contributor Advanced Programmer 
 
Salathe's Avatar
 
Join Date: Apr 2007
Posts: 1,393
Thanks: 5
Salathe is on a distinguished road
Default

Check the apache logs, does the module get loaded properly (ie, is there an error message)?
Salathe is offline  
Reply With Quote
Old 07-24-2009, 03:52 PM   #3 (permalink)
how quixotic are you?
 
ETbyrne's Avatar
 
Join Date: Dec 2007
Location: Lapeer, MI
Posts: 445
Thanks: 37
ETbyrne is on a distinguished road
Default

I checked the logs and there's nothing about any modules not loading correctly. Also mod_rewrite.so is in the modules directory.

Here's my .htaccess file if anyone is interested:

Code:
RewriteEngine on

RewriteCond $1 !^(index\.php|img|bin)
RewriteRule ^(.*)$ index.php?page=$1 [L]
It should be noted that the above worked on my old installation and works on my web host.
__________________
Dingo Web Systems > http://www.dingocode.com
My Website > http://www.evanbot.com
ETbyrne is offline  
Reply With Quote
Old 07-24-2009, 04:11 PM   #4 (permalink)
Moderateur
RegEx Guru PHP Guru Top Contributor Advanced Programmer 
 
Salathe's Avatar
 
Join Date: Apr 2007
Posts: 1,393
Thanks: 5
Salathe is on a distinguished road
Default

Is mod_rewrite not working at all, or just for your particular file quoted above?
Salathe is offline  
Reply With Quote
Old 07-24-2009, 10:34 PM   #5 (permalink)
how quixotic are you?
 
ETbyrne's Avatar
 
Join Date: Dec 2007
Location: Lapeer, MI
Posts: 445
Thanks: 37
ETbyrne is on a distinguished road
Default

I did a few other simple tests and it won't work at all.
__________________
Dingo Web Systems > http://www.dingocode.com
My Website > http://www.evanbot.com
ETbyrne is offline  
Reply With Quote
Old 07-24-2009, 11:06 PM   #6 (permalink)
The Acquainted
 
Join Date: Sep 2007
Posts: 126
Thanks: 4
Sam Granger is on a distinguished road
Default

Very odd. Have you checked if there are any other httpd.conf files? I remember having to change a lot of php.ini files in xampp to found out which one had to be editted
Sam Granger is offline  
Reply With Quote
Old 07-25-2009, 03:50 PM   #7 (permalink)
how quixotic are you?
 
ETbyrne's Avatar
 
Join Date: Dec 2007
Location: Lapeer, MI
Posts: 445
Thanks: 37
ETbyrne is on a distinguished road
Default

Installing Apache manually is a lot different from XAMPP you only have one httpd.conf file. I'm not sure why XAMPP has multiple httpd.conf files.
__________________
Dingo Web Systems > http://www.dingocode.com
My Website > http://www.evanbot.com
ETbyrne is offline  
Reply With Quote
Old 07-25-2009, 05:31 PM   #8 (permalink)
The Prestige
Advanced Programmer Top Contributor Good Samaritan 
 
sketchMedia's Avatar
 
Join Date: Oct 2007
Location: Manchester, UK
Posts: 854
Thanks: 32
sketchMedia is on a distinguished road
Default

Quote:
Originally Posted by ETbyrne View Post
Installing Apache manually is a lot different from XAMPP you only have one httpd.conf file. I'm not sure why XAMPP has multiple httpd.conf files.
Yea, XAMPP is a bit of a mess from what I remember of it. That's why I compiled my own LAMP server

A stab in the dark here.

Do you have:
Code:
AccessFileName .htaccess
in your .conf file? if not add it. This tells apache to look for .htaccess files

Find, in your vhost (should be in the <Directory> section):
Code:
AllowOverride None
And change it to (well for relevant directories ofc):
Code:
AllowOverride All
That directive basically tells apache what to do with .htaccess files when it finds them and what directives it will read.

Then give it a boot up the backside:
Code:
/etc/init.d/apache2 restart
or
Code:
/etc/init.d/httpd restart
depending on your distro ofc.

I'll keep thinking about solutions, its quite hard for me atm coz my setup seems to be slightly different.
__________________
mysql> SELECT * FROM `users` WHERE `users`.`clue` > 0;
Empty set (0.00 sec)
sketchMedia is offline  
Reply With Quote
The Following User Says Thank You to sketchMedia For This Useful Post:
ETbyrne (07-25-2009)
Old 07-25-2009, 08:33 PM   #9 (permalink)
how quixotic are you?
 
ETbyrne's Avatar
 
Join Date: Dec 2007
Location: Lapeer, MI
Posts: 445
Thanks: 37
ETbyrne is on a distinguished road
Default

Ah yes thank you! Changing AllowOverride to All in httpd.conf did the trick!
__________________
Dingo Web Systems > http://www.dingocode.com
My Website > http://www.evanbot.com
ETbyrne is offline  
Reply With Quote
Old 07-26-2009, 02:42 AM   #10 (permalink)
The Prestige
Advanced Programmer Top Contributor Good Samaritan 
 
sketchMedia's Avatar
 
Join Date: Oct 2007
Location: Manchester, UK
Posts: 854
Thanks: 32
sketchMedia is on a distinguished road
Default

Quote:
Originally Posted by ETbyrne View Post
Ah yes thank you! Changing AllowOverride to All in httpd.conf did the trick!
No problem m8, glad you got it sorted!
__________________
mysql> SELECT * FROM `users` WHERE `users`.`clue` > 0;
Empty set (0.00 sec)
sketchMedia is offline  
Reply With Quote
Old 07-26-2009, 09:57 AM   #11 (permalink)
Moderateur
RegEx Guru PHP Guru Top Contributor Advanced Programmer 
 
Salathe's Avatar
 
Join Date: Apr 2007
Posts: 1,393
Thanks: 5
Salathe is on a distinguished road
Default

I thought about AllowOverride but figured it was too basic a thing to overlook, good job Sketch on pointing it out.
Salathe is offline  
Reply With Quote
Old 03-03-2010, 11:00 AM   #12 (permalink)
The Wanderer
 
Join Date: Mar 2010
Posts: 8
Thanks: 0
infonama is on a distinguished road
Default

My mod_rewrite also not working, and my website is hosted on Linux server, how can i turn on the mod_rewrite?
__________________
Latest News
Download Free Songs
infonama is offline  
Reply With Quote
Old 03-03-2010, 05:57 PM   #13 (permalink)
is cute and cuddly
 
delayedinsanity's Avatar
 
Join Date: Mar 2008
Location: Vegas, Baby
Posts: 963
Thanks: 31
delayedinsanity is on a distinguished road
Default

Linux, with Apache? nginx? lighttpd? There are different rewrite methodologies for each.

Have you installed the module and activated it? You will need to be on a private server of some sort to do this, most shared hosts will not give you the option (if you are on shared, ask them about their policies)

Have you double checked all the information provided above? Some of the simplest things can be overlooked and completely default the other attempts you've made.

Have you double checked your mod_rewrite rules that you are attempting to use? Start with something basic, such as removing file extensions or just accessing a single page from a slightly different name.
delayedinsanity is offline  
Reply With Quote
Old 08-10-2011, 08:14 AM   #14 (permalink)
The Visitor
 
Join Date: Aug 2011
Posts: 2
Thanks: 0
benjamin444 is on a distinguished road
Default

installed a new redhat server and am trying to get mod_rewrite working.

Both these lines are uncommended in httpd.conf
LoadModule rewrite_module
AddModule mod_rewrite.c

I have also done
<Directory />
Options All
AllowOverride All
</Directory>

.htaccess file looks like
ErrorDocument 404 [domain.com...]

but when I type in www.domain.com/sdfgkjdf.html it receives a 404 error and is not redirected.

info.php shows mod_rewrite enabled.

______________________
MBA consultants in India
benjamin444 is offline  
Reply With Quote
Old 08-15-2011, 04:07 AM   #15 (permalink)
The Acquainted
 
wGEric's Avatar
 
Join Date: Nov 2007
Posts: 166
Thanks: 0
wGEric is on a distinguished road
Default

Did you add any rewrite rules?
__________________
Eric
wGEric is offline  
Reply With Quote
Old 08-15-2011, 06:53 AM   #16 (permalink)
The Acquainted
 
Join Date: Nov 2009
Location: nr Stratford-Upon-Avon
Posts: 137
Thanks: 3
maeltar is on a distinguished road
Default

You could always use the easy way out and create a custom 404 doc that has a redirect in it.
__________________
Thanks... Simon

Sex, Drugs & Linux Rules
Send a message via MSN to maeltar
maeltar is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Wamp working, but what next? Help! DotNetTim Absolute Beginners 3 02-07-2009 10:05 AM
Mod Rewrite only partially working Gareth General 6 12-24-2008 06:08 PM
Exec(zip) in PHP not working as expected oscargodson General 3 09-28-2008 12:00 PM
function that returns an array -- why not working? Dave Absolute Beginners 3 08-13-2008 05:01 PM
Header(location) stop working? marxx General 5 05-06-2008 08:32 PM


All times are GMT. The time now is 01:23 PM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design