mod rewrite
Moderator: General Moderators
mod rewrite
I recently transferred from shared hosting to my own dedicated server. My mod rewrite rules don't work on the new server, so I figure there's something in the httpd.conf file that I need to edit. I've looked through it, but I can't seem to find anything.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
- Buddha443556
- Forum Regular
- Posts: 873
- Joined: Fri Mar 19, 2004 1:51 pm
Got ...
... and ...
... in your httpd.conf? Might be commented out.
Code: Select all
LoadModule rewrite_module modules/mod_rewrite.soCode: Select all
AddModule mod_rewrite.c
Last edited by Buddha443556 on Fri Nov 25, 2005 5:22 pm, edited 1 time in total.
In addition to what ~Buddha443556 said, there may be another part of the conf file that allows modules to be activated in particular directories. By default, what *is* allowed is pretty restricted - hosts have to open it up a bit. Here's an example from one of my servers:
These were the original lines
These are the changed lines
These were the original lines
Code: Select all
<Directory "SYS:/APACHE2/htdocs">
Options Indexes FollowSymLinks
AllowOverride none
Order allow,deny
Allow from none
</Directory>Code: Select all
<Directory "SYS:/APACHE2/htdocs">
Options Indexes FollowSymLinks
AllowOverride all
Order allow,deny
Allow from all
</Directory>Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
This is what my httpd.conf looks like
Code: Select all
LoadModule rewrite_module libexec/mod_rewrite.so
// further down
AddModule mod_rewrite.c
// neither one of those are commented out
// even further down
# First, we configure the "default" to be a very restrictive set of
# permissions.
#
<Directory />
Options All
AllowOverride All
</Directory>
// Further down
<Directory "/usr/local/apache/htdocs">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
Allow from all
</Directory>Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
- Buddha443556
- Forum Regular
- Posts: 873
- Joined: Fri Mar 19, 2004 1:51 pm
Got this in your htaccess?
Here's a real long shot ... maybe someone changed AccessFileName?
Yep ... I'm running out of ideas. No error message anywhere?
Code: Select all
RewriteEngine onCode: Select all
AccessFileName .htaccess.htaccess
this is the line you mentioned
What should be happening:
http://204.15.77.162/~scott/showme.php?u=scrotaye should be rewriting to
http://204.15.77.162/~scott/scrotaye
as you can tell by clicking on the links, the first one works, and the second one doesn't.
and as far as the error logs go, I don't know. this is my first time working with ssh and a dedicated server and freebsd, so I feel very n00b. I don't know where the error logs are yet.
Code: Select all
Options -Indexes
RewriteEngine on
RewriteRule ^([a-zA-Z0-9_-]+)(/)?$ showme.php?u=$1
RewriteRule ^photos/([a-zA-Z0-9_-]+)(/)?$ /albums.php?u=$1
RewriteRule ^photos/([a-zA-Z0-9_-]+)/([0-9]+)(/)?$ /albums.php?u=$1&aid=$2
RewriteRule ^blog/([a-zA-Z0-9_-]+)(/)?$ /blogit.php?busername=$1Code: Select all
AccessFileName .htaccesshttp://204.15.77.162/~scott/showme.php?u=scrotaye should be rewriting to
http://204.15.77.162/~scott/scrotaye
as you can tell by clicking on the links, the first one works, and the second one doesn't.
and as far as the error logs go, I don't know. this is my first time working with ssh and a dedicated server and freebsd, so I feel very n00b. I don't know where the error logs are yet.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
rebooted the whole system 
im really at a loss here. if someone likes, I will PM them the whole httpd.conf file... if someone is willing to take a look at it.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.