Results 1 to 3 of 3

Thread: mod_rewrite

  1. #1
    Junior Member
    Join Date
    Jan 2013
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Default mod_rewrite

    Hi,

    I have inherited a vhosts .conf file listed below. It was already doing a rewrite http to https which was working fine. I have added the line in red (and several variations of the same thing), which should be redirecting from an index.html page on root to a folder common/. After the update i run a graceful restart. The redirect did not work although the http to https still works. Grateful for any help or suggestions as to where I am going wrong.

    Thanks
    Mathew


    <VirtualHost *:80>
    ServerName myservernamehere.com


    DocumentRoot /var/www/html
    <Directory /var/www/html/>
    Options Indexes FollowSymLinks MultiViews
    AllowOverride None
    Order allow,deny
    allow from all
    </Directory>


    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel warn


    RewriteEngine On
    RewriteRule 302 /index.html /common/

    RewriteCond %{HTTPS} off
    RewriteRule /(.*) https://%{HTTP_HOST}%{REQUEST_URI}

    </VirtualHost>

  2. #2
    Senior Member
    Join Date
    Jul 2006
    Location
    India, Delhi
    Posts
    206
    Thanks
    3
    Thanked 1 Time in 1 Post
    Rep Power
    7

    Default

    U should either below method

    RewriteEngine On
    RewriteRule ^index.html /common/ [R=302,NC]

    or
    Redirect 302 /index.html /common/

    -Manish

  3. #3
    Junior Member
    Join Date
    Jan 2013
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Default

    Quote Originally Posted by kasimani View Post
    U should either below method

    RewriteEngine On
    RewriteRule ^index.html /common/ [R=302,NC]

    or
    Redirect 302 /index.html /common/

    -Manish
    Thanks Manish.

    i eventually got around to trying the above but i did not work for me although other rules i had in there worked fine.
    Could there be some config elsewhere which could be preventing this redirect?

    Thanks
    Mathew

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 2
    Last Post: 19th January 2010, 01:30 PM
  2. mod_rewrite with convertion of space and / to _
    By kasimani in forum Networking, Firewalls and Security
    Replies: 0
    Last Post: 13th March 2007, 11:52 AM
  3. mod_rewrite with convertion of space and / to _
    By kasimani in forum Web servers
    Replies: 0
    Last Post: 13th March 2007, 11:51 AM
  4. confused with mod_rewrite
    By kasimani in forum Coding in General
    Replies: 0
    Last Post: 20th January 2007, 01:46 PM
  5. mod_rewrite in apache: rewritecond
    By kasimani in forum Web servers
    Replies: 0
    Last Post: 19th January 2007, 11:19 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41