469,299 Members | 2,132 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,299 developers. It's quick & easy.

.htaccess file -> error 500


Hello,
Im using this .htaccess file to rewrite my websites URL. Reason i try
to do this is to make it more SEO friendly.

Code:
--------------------------------------------------------
Options +FollowSymLinks

RewriteEngine On
RewriteBase mywebsite.awardspace.com

RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule ^(.+)\.html$ index.php?n=$1 [QSA,L]

--------------------------------------------------------

I keep getting the error 500, probably due to a faulty line behind the
RewriteBase.
How should i change this line to make it work?

Tnx,
Spamkip.

Nov 1 '07 #1
9 4249
invertigo wrote:
>
Hello,
Im using this .htaccess file to rewrite my websites URL. Reason i try
to do this is to make it more SEO friendly.

Code:
--------------------------------------------------------
Options +FollowSymLinks

RewriteEngine On
RewriteBase mywebsite.awardspace.com

RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule ^(.+)\.html$ index.php?n=$1 [QSA,L]

--------------------------------------------------------

I keep getting the error 500, probably due to a faulty line behind the
RewriteBase.
How should i change this line to make it work?
Off-topic on comp.infosystems.www.authoring.html.
Follow up to alt.apache.configuration.

--
If you've a question that doesn't belong to Usenet, contact me at
<ta*****************@yahoDELETETHATo.fr>
Nov 1 '07 #2
invertigo <sp*******@gmail.comwrites:
Im using this .htaccess file to rewrite my websites URL. Reason i try
to do this is to make it more SEO friendly.
"SEO friendly" is pure snake-oil.

If your page is valid HTML, your content will be accessible and indexable
by search engines. If your page is *not* valid, accessible HTML, then you
should fix the core problem instead of applying an SEO band-aid.
How should i change this line to make it work?
This group is about HTML authoring, not Apache configuration. Try asking
in the comp.infosystems.www.servers.unix group.

sherm--

--
Web Hosting by West Virginians, for West Virginians: http://wv-www.net
Cocoa programming in Perl: http://camelbones.sourceforge.net
Nov 1 '07 #3
Thank you very much for your reply's :)
Page is Valid HTML according to the W3C markup validator, The reason
im using this .HTaccess scripts is pretty simple, I'm using a CMS,
which codes the links like
http://mywebsite.com/?n=modules/forum
Wouldnt it be way better to .htaccess them to http://mywebsite.com/forum.html
? :)

Nov 1 '07 #4
Gazing into my crystal ball I observed invertigo <sp*******@gmail.com>
writing in news:11**********************@22g2000hsm.googlegro ups.com:
Thank you very much for your reply's :)
Page is Valid HTML according to the W3C markup validator, The reason
im using this .HTaccess scripts is pretty simple, I'm using a CMS,
which codes the links like
http://mywebsite.com/?n=modules/forum
Wouldnt it be way better to .htaccess them to
http://mywebsite.com/forum.html ? :)

If a page is well structured, then a robot has no problems with
querystrings.

--
Adrienne Boswell at Home
Arbpen Web Site Design Services
http://www.cavalcade-of-coding.info
Please respond to the group so others can share

Nov 1 '07 #5
On Thu, 01 Nov 2007 15:18:05 +0100, Adrienne Boswell <ar****@yahoo.com
wrote:
Gazing into my crystal ball I observed invertigo <sp*******@gmail.com>
writing in news:11**********************@22g2000hsm.googlegro ups.com:
>Thank you very much for your reply's :)
Page is Valid HTML according to the W3C markup validator, The reason
im using this .HTaccess scripts is pretty simple, I'm using a CMS,
which codes the links like
http://mywebsite.com/?n=modules/forum
Wouldnt it be way better to .htaccess them to
http://mywebsite.com/forum.html ? :)
If a page is well structured, then a robot has no problems with
querystrings.
A robot hasn't, people have. Ideally, I'd like to make urls guessable for
visitors, and easily remembered by previous visitors. Not all traffic
comes from links, word of mouth, printed media etc. can also attract
visitors. While this isn't strictly SEO (we 'skip' the search engine), I'd
think this it quite a good practise.
--
Rik Wasmus
Nov 1 '07 #6
invertigo wrote:
Thank you very much for your reply's :)
Page is Valid HTML according to the W3C markup validator, The reason
im using this .HTaccess scripts is pretty simple, I'm using a CMS,
which codes the links like
http://mywebsite.com/?n=modules/forum
Wouldnt it be way better to .htaccess them to
http://mywebsite.com/forum.html
? :)
Yes, it's a "better" URI, as it's more human friendly, and practically
less likely to change when you redesign your website, even though,
theoritically, you could keep the ugly URI as easily as the pretty URI.
However, experience shows that web designers who design ugly URI don't
bother keeping them alive.

However, http://mywebsite.com/forum is even better than
http://mywebsite.com/forum.html.

It doesn't directly affect search engines. However, if you keep your URI
alive, you'll be accessible from all the pages that refer to your site
(instead of displaying the 404 error), which, indirectly, will improve
your page rank, but, much more directly, will improve the accessibility of
your site.

Good URI don't change.

Now, back to your specific issue.
1) If your site has used the ugly URI for some time, then, do not change
it! Simply, keep them as they are forever, even if the underlying
architecture changes!
People don't like 404 errors. Neither do search engines.
A 301 redirection is better but, if you don't keep it forever, nobody will
ever update their links.
A 302 redirection that you would keep forever could be acceptable.

2) If your site has never ever been publically available with the ugly
URI, then, use the pretty one.

You may read this article written by Tim Berners Lee:
http://www.w3.org/Provider/Style/URI

--
If you've a question that doesn't belong to Usenet, contact me at
<ta*****************@yahoDELETETHATo.fr>
Nov 1 '07 #7

My website hasnt been published yet, I do have a domain though :).
No need to redirect, I can just make them pretty right away, sounds
pretty feasable!

So yes, I am going for the pretty ones!
Problem is though, i cant get the .htaccess to work.. it keeps
bouncing back a 500 error, no matter what i stash behind the
RewriteBase tag.

This is the general .htaccess neat links code:
Code:
--------------------------------------------------------
Options +FollowSymLinks

RewriteEngine On
RewriteBase /subdomain/subsubdomain

RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule ^(.+)\.html$ index.php?n=$1 [QSA,L]

--------------------------------------------------------

Concerning you idea bout removing the .html, that part isnt that hard
to accomplish, in fact, its just a simple rewrite of the
RewriteRule :). But getting first part to work.. nightmare.

Nov 1 '07 #8
invertigo wrote:
>
Hello,
Im using this .htaccess file to rewrite my websites URL. Reason i try
to do this is to make it more SEO friendly.
<snip>
RewriteBase mywebsite.awardspace.com
<snip>

That looks very suspicious.
Read:
http://httpd.apache.org/docs/2.2/mod...en#rewriterule

If there's an Alias such as: "Alias /url/path /dir/path", use a
RewriteBase such as "RewriteBase /url/path", otherwise, don't use
RewriteBase.

--
If you've a question that doesn't belong to Usenet, contact me at
<ta*****************@yahoDELETETHATo.fr>
Nov 1 '07 #9
..oO(invertigo)
>Im using this .htaccess file to rewrite my websites URL. Reason i try
to do this is to make it more SEO friendly.

Code:
--------------------------------------------------------
Options +FollowSymLinks

RewriteEngine On
RewriteBase mywebsite.awardspace.com

RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule ^(.+)\.html$ index.php?n=$1 [QSA,L]

--------------------------------------------------------

I keep getting the error 500, probably due to a faulty line behind the
RewriteBase.
How should i change this line to make it work?
Logfiles exist. A 500 usually drops a message in the server's error log.
You could also enable the RewriteLog to see what's going on (or not).

Micha
Nov 1 '07 #10

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

8 posts views Thread by Joshua Beall | last post: by
7 posts views Thread by Nel | last post: by
7 posts views Thread by John | last post: by
13 posts views Thread by Bob Bedford | last post: by
reply views Thread by Stoco | last post: by
4 posts views Thread by Stefan Bellon | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by harlem98 | last post: by
1 post views Thread by Geralt96 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.