DjMikeS Posted October 18, 2008 Share Posted October 18, 2008 Hi all, I've got a problem with mod_rewrite and I can't figure it out. I'm trying to rewrite http://dev.phison.nl/index.php?section=home to http://dev.phison.nl/section/home/ and for some reason I keep getting the dreaded 404 error. Also, my error.log shows a "File does not exist" error...leading me to think that mod_rewrite is not enabled...But when I open phpinfo() it does appear to be loaded... Can anyone help? Some files: .htaccess RewriteEngine On RewriteLog "/var/log/apache2/dev.phison.nl/rewrite.log" RewriteLogLevel 3 RewriteRule ^/(.*)/ index.php?section=$1 My virtualhost file: <VirtualHost *:80> ServerName dev.phison.nl DocumentRoot /var/www/dev.phison.nl ServerAdmin helpdesk@phison.nl Options +ExecCGI FollowSymLinks Indexes ErrorLog /var/log/apache2/dev.phison.nl/error.log CustomLog /var/log/apache2/dev.phison.nl/access.log combined <Directory /var/www/downloads.phison.nl/*> AllowOverride All </Directory> Am I missing something ? Quote Link to comment Share on other sites More sharing options...
JasonLewis Posted October 19, 2008 Share Posted October 19, 2008 Try this: RewriteRule ^section/([^/\.]+)/?$ index.php?section=$1 [L] Quote Link to comment Share on other sites More sharing options...
DjMikeS Posted October 19, 2008 Author Share Posted October 19, 2008 I've tried that and it works, but now I don't get any stylesheets and images...It rewrites every single file... My .htaccess RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f [OR] RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^section/([^/\.]+)$ index.php?section=$1 [L,QSA] example: http://dev.phison.nl/section/home As you can see it does load the correct page, it only fails to load the images, jscripts and stylesheets... Do anyone know how to correct this ? Quote Link to comment Share on other sites More sharing options...
JasonLewis Posted October 19, 2008 Share Posted October 19, 2008 Give images/styles/scripts, basically any link, the full link. I don't know of any mod_rewrite way, there might be. Quote Link to comment Share on other sites More sharing options...
DjMikeS Posted October 19, 2008 Author Share Posted October 19, 2008 Ahh, that works great...thnx a lot ! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.