Skip to main content

Using Redirect in htaccess

Comments

3 comments

  • durangod
    I never could get redirect to work, stupid half witted worthless apache instructions lol But i tested and this works.. #only check this 1 time #before all the other rewrites in your htaccess file #no need to check this on every rewrite code section #if mod_rewrite is disabled then send them #to a special error page RewriteRule ^.*$ no_rewrite.shtml [L]
    0
  • ffeingol
    The 3rd parameter is a URL and you don't have a URL ( mod_alias - Apache HTTP Server Version 2.4 ) I also dont' beleive you can use the rules (like [L]) since this is just a redirect and not a rewrite rule. So you'd want something like: # If mod rewrite enabled then redirect to special page Redirect 301 / https://www.example.com/no_rewrite.shtml
    0
  • durangod
    Thanks, i was trying to use a local dir file and in myscript and trying to not hardcode the full url... Dont forget that i added ! before the mod_ and changed the text comment to if mod rewrite is disabled :)
    0

Please sign in to leave a comment.