Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Httpd/Apache. PHP. mod_rewrite. Fedora 17

I' trying to install sweetcron and it needs mod_rewrite enabled. So, what's the easiest way to do this on Fedora 17?

like image 833
GarouDan Avatar asked Aug 08 '12 12:08

GarouDan


People also ask

What is mod_rewrite in Apache?

The mod_rewrite module uses a rule-based rewriting engine, based on a PCRE regular-expression parser, to rewrite requested URLs on the fly. By default, mod_rewrite maps a URL to a filesystem path. However, it can also be used to redirect one URL to another URL, or to invoke an internal proxy fetch.

How do you check whether mod_rewrite is enable on server?

In PHP, there is an inbuilt function called 'phpinfo'. By using this function, we can output all the Loaded Modules and see the 'mod_rewrite' is enabled or not. Syntax: phpinfo();

Do I need RewriteEngine on?

Yes, RewriteEngine and RewriteBase have to be specified only once. Save this answer. Show activity on this post. Without a RewriteBase / apache will probably guess incorrectly whether dir2/$1 is a file or URI path and redirect you to the wrong place.


1 Answers

Edit your httpd.conf (by default it lies in /etc/httpd/conf/)

Change option AllowOverride None to AllowOverride All

After that restart your Apache server.


You can test your rewrite engine by some simple redirect:

Options +FollowSymLinks
RewriteEngine On
RewriteRule (.*) http://stackoverflow.com
like image 124
Edward Ruchevits Avatar answered Sep 17 '22 21:09

Edward Ruchevits