[Webinar] Streamline your web hosting managementRegister Today

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 4991
  • Last Modified:

How to enable mod rewrite in openSUSE 10.3

I need to enable mod rewrite in openSUSE 10.3 to install CAKEPHP. So, far I have tried this
add rewrite to /etc/sysconfig/apache
Allow rewrite in Apache httpd.conf file.

Now when I check server with phpinfo() it says modrewrite is enabled but when I go to
it say object not found.
Now if I put cake folder inside www folder with a root privilege and browse to http://lcalhost/cake it gives me page without cake php mod enabled. You know without any color.

Any help will be greatly appreciated
  • 2
  • 2
1 Solution
apache enable mod_rewrite or a2enmod mod_rewrite...

also have you restarted apache?

is the .htaccess file in the root directory?

did you change the user permissions on the files?
nicholasnetAuthor Commented:
Well I did all that but it still shows page with mod rewrite disabled.
can you post the .htaccess file?
This can be done through the YaST administration Tool.

Click your Start Button in the GUI go to the menu 'System' and open up YaST
YaST -> Network Services -> HTTP Server
      - Go to the 'Server Modules' tab
      - Find 'rewrite' and toggle status
      - Click Finish to apply
YaST -> Network Services -> HTTP Server
      - Go to the 'Server Modules' tab
      - Find 'rewrite' and toggle status
      - Click Finish to apply

Or instead of the above option add one of the following entry depending on your architecure "/etc/apache2/sysconfig.d/loadmodule.conf"

LoadModule rewrite_module                 /usr/lib64/apache2-prefork/mod_rewrite.so
LoadModule rewrite_module                 /usr/lib32/apache2-prefork/mod_rewrite.so

Now I think your primary issue is your not allowing .htaccess files to be used (This was my problem after applying the YaST solution above). The following procedure will enable that for you.

In the /etc/apache2/httpd.conf file reflect the following:

# forbid access to the entire filesystem by default
<Directory />
    Options All
    AllowOverride All
    Order deny,allow
    Allow from all

# use .htaccess files for overriding,
AccessFileName .htaccess
# and never show them
<Files ~ "^\.ht">
    Order allow,deny
    Allow from all

Open the /etc/apache2/default-server.conf file and find the <Directory "/srv/www/htdocs"> portion

Set  "Options All" and "AllowOverride All" and "Allow from all"

Restart the apache web server
/etc/init.d/apache2 stop
/etc/init.d/apache2 start

You should now be running with mod_rewrite. I just tested this on a brand new install of SuSE10.3 myself.

To test this create a .htaccess file and place it in your webroot
Options +followsymlinks
RewriteEngine on
RewriteRule ^fake\.html$ /index.html [L]

Now make sure you have an index.html file in your webroot.
Visit your website using fake.html and it will take you to index.html

Featured Post

Take Control of Web Hosting For Your Clients

As a web developer or IT admin, successfully managing multiple client accounts can be challenging. In this webinar we will look at the tools provided by Media Temple and Plesk to make managing your clients’ hosting easier.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now