LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   .htaccess file being read but not functioning (https://www.linuxquestions.org/questions/linux-newbie-8/htaccess-file-being-read-but-not-functioning-4175468727/)

TRUNoise 07-06-2013 07:07 PM

.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

Linux MR 07-06-2013 09:10 PM

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]

TRUNoise 07-06-2013 09:15 PM

Quote:

Originally Posted by Linux MR (Post 4985447)
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. :(

Linux MR 07-06-2013 09:45 PM

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

TRUNoise 07-06-2013 09:49 PM

Quote:

Originally Posted by Linux MR (Post 4985465)
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! :)

Linux MR 07-07-2013 02:15 PM

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.

TRUNoise 07-07-2013 05:57 PM

Quote:

Originally Posted by Linux MR (Post 4985793)
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.

Linux MR 07-07-2013 08:01 PM

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

TRUNoise 07-08-2013 10:01 AM

Quote:

Originally Posted by Linux MR (Post 4985904)
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 :/


All times are GMT -5. The time now is 10:27 PM.