RewriteRule ^old\.html$ new.html
Command Flag
[R] Redirect you can add an =301 or =302 to change the type.
[F] Forces the url to be forbidden. 403 header
[G] Forces the url to be gone 401 header
[L] Last rule. (You should use this on all your rules that don’t link together)
[N] Next round. Rerun the rules again from the start
[C] Chains a rewrite rule together with the next rule.
[T] use T=MIME-type to force the file to be a mime type
[NS] Use if no sub request is requested
[NC] Makes the rule case INsensitive
[QSA] Query String Append use to add to an existing query string
[NE] Turns of normal escapes that are default in the rewriterule
[PT] Pass through to the handler (together with mod alias)
Skip the next rule S=3 skips the next 3 rules
[E] E=var sets an enviromental variable that can be called by other rules
Showing posts with label Mod rewrite. Show all posts
Showing posts with label Mod rewrite. Show all posts
5/29/2012
3/28/2011
Linux (Apache) : mod rewrite
root@debian:/a2enmod rewrite
Enabling module rewrite.
Run '/etc/init.d/apache2 restart' to activate new configuration!
root@debian:/var/log# /etc/init.d/apache2 restart
edit site
/etc/apache2/sites-enabled/000-default
ServerAdmin webmaster@localhost
DocumentRoot /var/www
Options FollowSymLinks
AllowOverride None
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
:
:
ดูที่โดยมองที่ AllowOverride None ให้เปลี่ยนเป็น All
#/etc/init.d/apache2 restart
ไฟล์ .htaccess
config apache : http://www.aboutdebian.com/internet.htm
Enabling module rewrite.
Run '/etc/init.d/apache2 restart' to activate new configuration!
root@debian:/var/log# /etc/init.d/apache2 restart
edit site
/etc/apache2/sites-enabled/000-default
ServerAdmin webmaster@localhost
DocumentRoot /var/www
Options FollowSymLinks
AllowOverride None
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
:
:
ดูที่
#/etc/init.d/apache2 restart
ไฟล์ .htaccess
config apache : http://www.aboutdebian.com/internet.htm
tag:
Apache,
Mod rewrite
Subscribe to:
Posts (Atom)