how to setup pretty urls and mod rewrite rules on linux apache2 web server
Page 1 of 1
how to setup pretty urls and mod rewrite rules on linux apache2 web server
First type this command
Now this command
Now look for the folder of your www folder
Example below shows what it should be for this to work.
now restart your web server (example of how to alias this as its very comon to want or need to restart your apache server!
now type
Type password when asked and vala!
This is an example of your .htaccess file to enable a custom pretty url!
Navigate to your www folder and right click, select terminal and type the following command
(# is a commented out line).
For more information about alias and making it perminant alias search this forum for the word alias
Thanks For reading! Enjoy!
- Code:
a2enmod rewrite
Now this command
- Code:
sudo gedit /etc/apache2/apache2.conf
Now look for the folder of your www folder
Example below shows what it should be for this to work.
- Code:
<Directory /var/www/html/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
now restart your web server (example of how to alias this as its very comon to want or need to restart your apache server!
- Code:
alias srest='sudo /etc/init.d/apache2 restart'
now type
- Code:
srest
Type password when asked and vala!
This is an example of your .htaccess file to enable a custom pretty url!
Navigate to your www folder and right click, select terminal and type the following command
- Code:
sudo gedit .htaccess
(# is a commented out line).
- Code:
RewriteEngine on
# Redirect Rule
RewriteCond %{THE_REQUEST} \?u=([^&\ ]+)($|\ )
RewriteRule ^ /%1? [L,R=301]
# Redirect Writeback
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)$ /user.php?u=$1 [L]
For more information about alias and making it perminant alias search this forum for the word alias
Thanks For reading! Enjoy!
Similar topics
» setup apache2 and mysql server on linux
» Allow mod rewrite engine on linux apache2 webserver
» Favico For Linux Web Server Apache2
» Linux Web Security For Apache2 Web Server
» Create A Subdomain Linux Apache2 Web Server Script
» Allow mod rewrite engine on linux apache2 webserver
» Favico For Linux Web Server Apache2
» Linux Web Security For Apache2 Web Server
» Create A Subdomain Linux Apache2 Web Server Script
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum