Page 1 of 2 12 LastLast
Results 1 to 10 of 17

Thread: .htaccess

  1. #1
    Join Date
    Jun 2011
    Beans
    87
    Distro
    Ubuntu 12.04 Precise Pangolin

    .htaccess

    hi every one,
    i am new with ubuntu server, i installed server just 3 days ago.
    i had made all configurations and everything is working fine except .htaccess i am googleing for 2days and whatever i had do the result is same .htaccess doesnt work. but it works on my other server at theplanet.com

    my .htaccess file is:

    RewriteEngine On
    RewriteRule ^i/(.+)$ indexa.php?sayfa=$1

  2. #2
    Join Date
    Nov 2008
    Location
    Boston MetroWest
    Beans
    16,326

    Re: .htaccess

    .htaccess files are disabled by default in Ubuntu Apache. If you look at /etc/apache2/sites-enabled/000-default, you'll see the defaults as defined in the "<Directory />" stanza. The directive "AllowOverride None" disables .htaccess files. You can either change that, or put the rewrite rules directly into the <VirtualHost> container for your site.

  3. #3
    Join Date
    Sep 2006
    Beans
    8,627
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: .htaccess

    Quote Originally Posted by SeijiSensei View Post
    ... or put the rewrite rules directly into the <VirtualHost> container for your site.
    +1 for working directly in the virtualhost. That keeps the configuration data all in the same place.

  4. #4
    Join Date
    Jun 2011
    Beans
    87
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: .htaccess

    Quote Originally Posted by SeijiSensei View Post
    ... or put the rewrite rules directly into the <VirtualHost> container for your site.
    Thank you. How can i put rewrite rules into <VirtualHost> containder???

  5. #5
    Join Date
    Jun 2009
    Beans
    40

    Re: .htaccess

    Quote Originally Posted by mandza View Post
    Thank you. How can i put rewrite rules into <VirtualHost> containder???
    You would put your rules directly inside of the <VirtualHost/> tag (located at /etc/apache2/sites-available/default) instead of in .htaccess files.

  6. #6
    Join Date
    Jun 2011
    Beans
    87
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: .htaccess

    Quote Originally Posted by sixcorners View Post
    You would put your rules directly inside of the <VirtualHost/> tag (located at /etc/apache2/sites-available/default) instead of in .htaccess files.
    thank you very much

  7. #7
    Join Date
    Jun 2011
    Beans
    87
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: .htaccess

    <VirtualHost *:80>
    ServerAdmin info@interbim.com.tr

    DocumentRoot /var/www
    RewriteEngine On
    RewriteRule ^i/(.+)$ indexa.php?sayfa=$1
    <Directory />
    Options FollowSymLinks
    AllowOverride All
    </Directory>
    <Directory /var/www/>
    Options Indexes FollowSymLinks MultiViews
    AllowOverride All
    Order allow,deny
    allow from all
    </Directory>

    ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
    <Directory "/usr/lib/cgi-bin">
    AllowOverride None
    Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
    Order allow,deny
    Allow from all
    </Directory>
    ...
    i had made my <virtualhost/> like this but it still dont work.
    i dont know what to do. :'(
    Last edited by mandza; June 4th, 2011 at 09:19 AM.

  8. #8
    Join Date
    Sep 2006
    Beans
    8,627
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: .htaccess

    Did you set this in a file in the directory /etc/apache2/sites-enabled/ and then reload the configuration?

  9. #9
    Join Date
    Jun 2011
    Beans
    87
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: .htaccess

    Quote Originally Posted by Lars Noodén View Post
    Did you set this in a file in the directory /etc/apache2/sites-enabled/ and then reload the configuration?
    Yes, i seti it in /etc/apache2/sites-enabled/ directory and reload configuration, it did not work, after that i had reboot server and it still dont work.

  10. #10
    Join Date
    Sep 2006
    Beans
    8,627
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: .htaccess

    What did apache2ctl configtest produce for output? That will point out any errors in the configuration file.

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

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