LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 07-06-2013, 07:07 PM   #1
TRUNoise
Member
 
Registered: Apr 2013
Location: /home/
Distribution: Ubuntu 14.04
Posts: 50

Rep: Reputation: 7
.htaccess file being read but not functioning


As said, my .htaccess file for a website I'm tweaking wont work correctly.
  • I know the .htaccess file is being read because if I put random letters inside of the .htaccess file at the top, going to the page on a browser returns a 500 error
  • mod_rewrite is enabled. I have a if statement in the .htaccess file to only run the code if the module is enabled/installed. (I have made sure it is by doing the first item listed but inside of the if statement; 500 error)
  • OS: Linux version 3.8.0-25-generic (buildd@roseapple) (gcc version 4.7.3 (Ubuntu/Linaro 4.7.3-1ubuntu1)) Ubuntu 13.04
  • Apache2 Version: Apache/2.2.22 (Ubuntu)

To view the website, click here.

The main problem if you can't spot it is that on the top toolbar, when for instance you try pressing the "Vote" link, it gives a 404 error.

This is the contents of /var/www
Link

Edit:
*Facepalm* I forgot to include what the coding in the .htaccess file is... v.v
.htaccess file

Last edited by TRUNoise; 07-06-2013 at 08:24 PM. Reason: Forgot the htaccess...
 
Old 07-06-2013, 09:10 PM   #2
Linux MR
Member
 
Registered: May 2013
Distribution: Red Hat, Scientific, Fedora, openSuSE, Mageia, Mint, Arch
Posts: 57

Rep: Reputation: Disabled
Looking at your .htaccess file

I think, and I could be wrong, but doesn't the $ mean one character and * means multiple characters; i'm thinking it's looking for vote(plus one more character) whereas ^vote(.*) says look for file starting with vote and ending with (.plus anything)

Anywho maybe this will have better luck for you

Quote:
RewriteRule ^vote(.*) vote.php [L]
RewriteRule ^donate(.*) donate.php [L]
RewriteRule ^register(.*) register.php [L]
 
Old 07-06-2013, 09:15 PM   #3
TRUNoise
Member
 
Registered: Apr 2013
Location: /home/
Distribution: Ubuntu 14.04
Posts: 50

Original Poster
Rep: Reputation: 7
Quote:
Originally Posted by Linux MR View Post
Looking at your .htaccess file

I think, and I could be wrong, but doesn't the $ mean one character and * means multiple characters; i'm thinking it's looking for vote(plus one more character) whereas ^vote(.*) says look for file starting with vote and ending with (.plus anything)

Anywho maybe this will have better luck for you
When I changed the vote line to what you put, it still did a 404.
 
Old 07-06-2013, 09:45 PM   #4
Linux MR
Member
 
Registered: May 2013
Distribution: Red Hat, Scientific, Fedora, openSuSE, Mageia, Mint, Arch
Posts: 57

Rep: Reputation: Disabled
sorry for the non-working suggestion, I have one more suggestion after re-reading the post (wow, I totally misread the post the first time ).

Quote:
RewriteRule ^vote$ $1.php [R=301,L]
if that doesn't work, then i'm fresh out of ideas
 
Old 07-06-2013, 09:49 PM   #5
TRUNoise
Member
 
Registered: Apr 2013
Location: /home/
Distribution: Ubuntu 14.04
Posts: 50

Original Poster
Rep: Reputation: 7
Quote:
Originally Posted by Linux MR View Post
sorry for the non-working suggestion, I have one more suggestion after re-reading the post (wow, I totally misread the post the first time ).



if that doesn't work, then i'm fresh out of ideas
Still nothing. :C

Thanks greatly for trying, though!
 
Old 07-07-2013, 02:15 PM   #6
Linux MR
Member
 
Registered: May 2013
Distribution: Red Hat, Scientific, Fedora, openSuSE, Mageia, Mint, Arch
Posts: 57

Rep: Reputation: Disabled
I'm back...hopefully this one solves it after playing with my own htaccess files.

First look in /etc/httpd/conf/httpd.conf for "placed in .htaccess"
you will need to change the value from AllowOverride None to AllowOverride All.

Then restart your apache service and hopefully that gets you over the hump.
 
Old 07-07-2013, 05:57 PM   #7
TRUNoise
Member
 
Registered: Apr 2013
Location: /home/
Distribution: Ubuntu 14.04
Posts: 50

Original Poster
Rep: Reputation: 7
Quote:
Originally Posted by Linux MR View Post
I'm back...hopefully this one solves it after playing with my own htaccess files.

First look in /etc/httpd/conf/httpd.conf for "placed in .htaccess"
you will need to change the value from AllowOverride None to AllowOverride All.

Then restart your apache service and hopefully that gets you over the hump.
I have no /etc/httpd/ directory.
 
Old 07-07-2013, 08:01 PM   #8
Linux MR
Member
 
Registered: May 2013
Distribution: Red Hat, Scientific, Fedora, openSuSE, Mageia, Mint, Arch
Posts: 57

Rep: Reputation: Disabled
hmm,ok...well the file you are looking to edit is httpd.conf

you can find it by either command
Quote:
# locate httpd.conf
# find / -name httpd.conf
 
Old 07-08-2013, 10:01 AM   #9
TRUNoise
Member
 
Registered: Apr 2013
Location: /home/
Distribution: Ubuntu 14.04
Posts: 50

Original Poster
Rep: Reputation: 7
Quote:
Originally Posted by Linux MR View Post
hmm,ok...well the file you are looking to edit is httpd.conf

you can find it by either command
The only results that came up are unrelated to apache :/
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how can i use htaccess file patience Linux - Software 1 08-04-2010 05:07 AM
.htaccess file Icantprintinlinux Linux - Newbie 1 11-02-2007 05:49 AM
File and folder permissions not functioning properly. MahsanS Linux - General 1 09-28-2005 12:37 PM
File and folder permissions not functioning properly. MahsanS Linux - Security 1 09-28-2005 12:36 PM
File and folder permissions not functioning properly. MahsanS Linux - Networking 1 09-28-2005 12:36 PM


All times are GMT -5. The time now is 04:39 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration