Jump to content

[SOLVED] mod_rewrite doesn't rewrite URL


DjMikeS

Recommended Posts

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 ?

Link to comment
Share on other sites

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 ?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.