below pasted is my htaccess file... please tell me if there is any mistake that I am doing
You are missing a few spaces before the flags.
You do not need two rules if your have /?, it means an optional slash.
You should use the L flag when a rule matches and needs no further mod_rewrite processing.
You can combine many of the rules.
None of that should cause this problem, though.
Try
- Code: Select all
Options All
# Disable Directory Browsing
Options +FollowSymLinks -Indexes
# Set up mod_rewrite
RewriteEngine On
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP/
RewriteRule ^index\.php$ http://www.example.com/ [R=301,L]
RewriteCond %{HTTP_REFERER} !^(http://(www\.)?example.com/.*)?$ [NC]
RewriteCond %{HTTP_REFERER} !search\?q=cache [NC]
RewriteCond %{HTTP_REFERER} !(answers|bing|blogger|google|live|msn|yahoo)\. [NC]
RewriteRule \.(jpg)$ http://www.example.com/thumb_default.gif [R,L]
RewriteCond %{HTTP_HOST} ^(example\.com)$ [NC]
RewriteRule .* http://www.%1%{REQUEST_URI} [R=301,L]
RewriteRule ^.+(/(css|files|images|js|pictures|thumb)/.+)$ $1 [L]
RewriteRule ^(about|approve|contact|faq|login|policy|redirect|submit)/?$ /$1.php [NC,L]
RewriteRule ^admin/comments(Rej)?/?$ /comments$1.php [NC]
RewriteRule ^sitemap\.html$ /sitemapHTML.php [NC,L]
RewriteRule ^all/latest/?$ /latest.php [NC,L]
RewriteRule ^page([0-9]+)/?$ /index.php?page=$1 [NC,L]
RewriteRule ^([-a-z0-9_]+)/?$ /category.php?category=$1 [NC,L]
RewriteRule ^user/([-a-z0-9_]+)/?$ /user.php?user=$1 [NC,L]
RewriteRule ^[-a-z0-9_]+/([0-9]+)/[-a-z0-9_]+\.html$ /story.php?id=$1 [NC,L]
RewriteRule ^tag/([-a-z0-9_]+)/?$ /tag.php?tag=$1 [NC,L]
RewriteRule ^rss/category/([-a-z0-9_]+)\.xml$ /categoryRss.php?category=$1 [NC,L]
RewriteRule ^example\.xml$ /rss.php [NC,L]
RewriteRule ^rss/user/([-a-z0-9_]+)\.xml$ /userRss.php?user=$1 [NC,L]
RewriteRule ^([-a-z0-9_]+)/page([0-9]+)/?$ /category.php?category=$1&page=$2 [NC,L]
RewriteRule ^all/latest/page([0-9]+)/?$ /latest.php?page=$1 [NC,L]
RewriteRule ^admin/comments(Rej)?/page([0-9]+)/?$ /comments$1.php?page=$2 [NC,L]
RewriteRule ^user/([-a-z0-9_]+)/page([0-9]+)/?$ /user.php?user=$1&page=$2 [NC,L]
the category tag and story page are giving a double reload
if you use firefox and open my website
http://www DOT example DOT com browse through story pages and you will notive that the pages are pinged once the link is clicked and then again the load on to the same page
it happens for the category page story page and the tag page
I see the problem, but i'm not sure mod_rewrite is the cause. Does this happen in any other browser?
my javascript file is not working on the page given below
It seems to work fine for me. Relative paths is not the problem, as /js/functions.js is only relative to the domain, not the browser URL.