DeveloperSide.NET Forums
November 21, 2019, 11:23:51 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: mod rewrite help?  (Read 15108 times)
0 Members and 1 Guest are viewing this topic.
night2dark2
Jr. Member
**
Posts: 98


Yeah Dont really ask.

mfaiotto@msn.com
View Profile WWW
« on: July 24, 2008, 09:00:51 PM »

Well mod rewrite isn't being activated.

I know my rewrite rules are correct but they arent working.

I have 2 .htaccess. See if im doing something wrong.

This one is at the root of the vhost.

Quote from: root .htaccess
RewriteEngine on
RewriteRule ^testing/news/([0-9][0-9])$ /testing/news/$1/ [R]
RewriteRule ^testing/news/([0-9][0-9])/$ /testing/news.php?newsid=$1

And this one is in the directory

Quote from:  directory .htaccess
RewriteEngine on
RewriteRule ^news/([0-9][0-9])$ /news/$1/ [R]
RewriteRule ^news/([0-9][0-9])/$ /news.php?newsid=$1

What am i doing wrong?

you can go test that out
http://cp.revgamers.net/tesitng/news/1/

news.php?newsid=1 is supposed to be letting that be executed but its not.
Logged

Revolution Gamers Host.
Master of all Gunz Server Hosting Needs.
Revolution Gamers International Gaming Commmunity
admin
Administrator
Master of All Subjects
*****
Posts: 3272


View Profile WWW Email
« Reply #1 on: July 24, 2008, 09:26:47 PM »

Have you checked error.log?

Also note that you have to have 'Options FollowSymLinks' on for the Directory and at least an 'AllowOverride FileInfo' there as well.

You can also put mod_rewrite into debug mode and it will show you exactly what it is doing, though it's quite a bit of information.

Check http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html#rewriteloglevel and the RewriteLog directive.
Logged

DeveloperSide.NET
Advanced PHP and MySQL Solutions for your Web Design and Development needs with Web.Developer Server Suite.
night2dark2
Jr. Member
**
Posts: 98


Yeah Dont really ask.

mfaiotto@msn.com
View Profile WWW
« Reply #2 on: July 24, 2008, 09:42:52 PM »

this is my .htaccess now but now its giving internal server error when i request it.
Quote from: htaccess
Options FollowSymLinks
RewriteEngine on
RewriteLog "/www/vhosts/cp.revgamers.net/tesitng/erorr/rewrite.log"
RewriteLogLevel 3
RewriteCond %{QUERY_STRING} ^newsid=([$&]+)$
RewriteRule ^news/([0-9][0-9])$ //news/$1/ [R]
RewriteRule ^news/([0-9][0-9])/$ /news.php?newsid=$1

Thats the one inside C:\www\vhosts\cp.revgamers.net\testing\
« Last Edit: July 24, 2008, 10:01:12 PM by night2dark2 » Logged

Revolution Gamers Host.
Master of all Gunz Server Hosting Needs.
Revolution Gamers International Gaming Commmunity
admin
Administrator
Master of All Subjects
*****
Posts: 3272


View Profile WWW Email
« Reply #3 on: July 24, 2008, 09:52:58 PM »

Options and AllowOverride directives can only go into the main configurations files. You cannot place them inside .htaccess files.
Logged

DeveloperSide.NET
Advanced PHP and MySQL Solutions for your Web Design and Development needs with Web.Developer Server Suite.
night2dark2
Jr. Member
**
Posts: 98


Yeah Dont really ask.

mfaiotto@msn.com
View Profile WWW
« Reply #4 on: July 24, 2008, 10:01:39 PM »

Okay Options are set to all and allowoverride is already all. and its still not working
Logged

Revolution Gamers Host.
Master of all Gunz Server Hosting Needs.
Revolution Gamers International Gaming Commmunity
night2dark2
Jr. Member
**
Posts: 98


Yeah Dont really ask.

mfaiotto@msn.com
View Profile WWW
« Reply #5 on: July 24, 2008, 10:15:40 PM »

this is my htaccess
Quote from: htaccess
RewriteEngine on
RewriteRule ^testing/news/([0-9][0-9])$ /testing/news/$1/ [R]
RewriteRule ^testing/news/([0-9][0-9])/$ /testing/news.php?newsid=$1

And this is how i have hte vhost setup/
Quote from: vhosts
<VirtualHost *:80>
   ServerName cp.revgamers.net
   ServerAlias cp.revgamers.net
   DocumentRoot "/www/vhosts/cp.revgamers.net"
   ErrorLog /www/Apache22/logs/error.log

   <Directory "/www/vhosts/cp.revgamers.net">
      Options All
      AllowOverride All
      order allow,deny
      allow from all
   </Directory>

   <Directory "/www/vhosts/cp.revgamers.net/testing/">
      AllowOverride FileInfo
   </Directory>
</VirtualHost>
Logged

Revolution Gamers Host.
Master of all Gunz Server Hosting Needs.
Revolution Gamers International Gaming Commmunity
night2dark2
Jr. Member
**
Posts: 98


Yeah Dont really ask.

mfaiotto@msn.com
View Profile WWW
« Reply #6 on: July 25, 2008, 01:29:40 AM »

Its still not working. help please
Logged

Revolution Gamers Host.
Master of all Gunz Server Hosting Needs.
Revolution Gamers International Gaming Commmunity
admin
Administrator
Master of All Subjects
*****
Posts: 3272


View Profile WWW Email
« Reply #7 on: July 25, 2008, 03:19:15 AM »

Take out that 1st rule and use this instead...
RewriteRule ^testing/news/([0-9]+)/$ /testing/news.php?newsid=$1

That should rewrite /tesitng/news/1/ to /testing/news.php?newsid=1
« Last Edit: July 25, 2008, 03:20:57 AM by admin » Logged

DeveloperSide.NET
Advanced PHP and MySQL Solutions for your Web Design and Development needs with Web.Developer Server Suite.
night2dark2
Jr. Member
**
Posts: 98


Yeah Dont really ask.

mfaiotto@msn.com
View Profile WWW
« Reply #8 on: July 25, 2008, 02:15:17 PM »

Okay i got mod rewrite to work by referencing into my vbseo's htaccess configuration. But heres my problem now. My images arent all being included like http://cp.revgamers.net/testing/images/ their just being included as images/image.png so i get an empty effect. So how am i supposed to fix this now since the site doesn't like that prefix when using mod rewrite.

this is my mod-rewrite config now

Quote from: config
Options +FollowSymLinks
# Note Options +FollowSymLinks work inside because vbseo has the same inside of it
# Rewrite Engine Turn on
RewriteEngine On
#Say what the base to be rewritten
RewriteBase /testing
# Rewrite news/ to news.php
RewriteRule ^news/$ news.php [L]
#Rewrite news/blah to news/blah/
RewriteRule ^news/([0-9]+)$ news/$1/ [L]
#Rewrite news/blah/ to news.php?newsid=blah
RewriteRule ^news/([0-9]+)/$ news.php?newsid=$1
« Last Edit: July 25, 2008, 02:18:08 PM by night2dark2 » Logged

Revolution Gamers Host.
Master of all Gunz Server Hosting Needs.
Revolution Gamers International Gaming Commmunity
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.9 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!