Using Redirect in htaccess
Hi, i thought i would try to learn how to use redirect in htaccess but its not going well at all.
Here is what i have so far... i know its wrong just not sure where..
The trick is if i can learn to get it to redirect with it on, then i think all i have to do is add the ! symbol
like this to check if its off
(i think) lol
thanks
# If mod rewrite enabled then redirect to special page
Redirect 301 / no_rewrite.shtml [L]
thanks
-
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 -
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.shtml0 -
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.
Comments
3 comments