mod_rewrite not working

Status
Not open for further replies.

spam.aniket88

New Member
Messages
6
Reaction score
0
Points
0
I want to enable seo friendly urls in Joomla.
I enable them, i enable mod_rewrite in joomla global settings.
Also renamed the htaccess.txt to .htaccess
But still I get Page Not Found error.
What needs to be done? I searched the forum, it says mod_rewrite is enabled for free users.
Plz suggest.
 

lemon-tree

x10 Minion
Community Support
Messages
1,420
Reaction score
46
Points
48
URL rewriting is enabled, so any issues you are experiencing will be a result of an error in your .htacess
A common solution to this problem could be to add the line "RewriteBase /" to the to your .htacess file; if this does not solve it then please paste your .htaccess file's contents here and we'll take a look at where it might be going awry.
 

spam.aniket88

New Member
Messages
6
Reaction score
0
Points
0
I don't understand much about the htaccess, but its the default that comes with joomla.
I would hv uploaded it here, but I am not able to see it in my directory so I can't download it. But its surely present becoz when I try to create a new .htaccess in that directory, it says that the file already exists.

Earlier I was testing few other scripts, but I faced same problem.

---------- Post added at 08:20 AM ---------- Previous post was at 07:23 AM ----------

THIS is how I got my .htaccess
---------

##
# @version $Id: htaccess.txt 14401 2010-01-26 14:10:00Z louis $
# @package Joomla
# @copyright Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
# @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
# Joomla! is Free Software
##


#####################################################
# READ THIS COMPLETELY IF YOU CHOOSE TO USE THIS FILE
#
# The line just below this section: 'Options +FollowSymLinks' may cause problems
# with some server configurations. It is required for use of mod_rewrite, but may already
# be set by your server administrator in a way that dissallows changing it in
# your .htaccess file. If using it causes your server to error out, comment it out (add # to
# beginning of line), reload your site in your browser and test your sef url's. If they work,
# it has been set by your server administrator and you do not need it set here.
#
#####################################################

## Can be commented out if causes errors, see notes above.
Options +FollowSymLinks

#
# mod_rewrite in use

RewriteEngine On

########## Begin - Rewrite rules to block out some common exploits
## If you experience problems on your site block out the operations listed below
## This attempts to block the most common type of exploit `attempts` to Joomla!
#
## Deny access to extension xml files (uncomment out to activate)
#<Files ~ "\.xml$">
#Order allow,deny
#Deny from all
#Satisfy all
#</Files>
## End of deny access to extension xml files
RewriteCond %{QUERY_STRING} mosConfig_[a-zA-Z_]{1,21}(=|\%3D) [OR]
# Block out any script trying to base64_encode crap to send via URL
RewriteCond %{QUERY_STRING} base64_encode.*\(.*\) [OR]
# Block out any script that includes a <script> tag in URL
RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]
# Block out any script trying to set a PHP GLOBALS variable via URL
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
# Block out any script trying to modify a _REQUEST variable via URL
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
# Send all blocked request to homepage with 403 Forbidden error!
RewriteRule ^(.*)$ index.php [F,L]
#
########## End - Rewrite rules to block out some common exploits

# Uncomment following line if your webserver's URL
# is not directly related to physical file paths.
# Update Your Joomla! Directory (/joomla)

# RewriteBase /


########## Begin - Joomla! core SEF Section
#
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/index.php
RewriteCond %{REQUEST_URI} (/|\.php|\.html|\.htm|\.feed|\.pdf|\.raw|/[^.]*)$ [NC]
RewriteRule (.*) index.php
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
#
########## End - Joomla! core SEF Section

-----------
This is how I got my default, as you said I enabled RewriteBase / , the rewrite took place but its displaying wrong page. I have intalled the script in subdirectory /joomla.

For you to see I am keeping it RewriteBase / enabled.

Check:
http://fblikes.x10.bz/joomla/

Then click on 'Directory' and see the problem:
http://fblikes.x10.bz/joomla/odp

Its not displaying the page it should display bt displaying page of home url page of http://fblikes.x10.bz/ with incorrect css.
 

lemon-tree

x10 Minion
Community Support
Messages
1,420
Reaction score
46
Points
48
OK, judging from that it appears your redirect is now working fine and the issue with the CSS is merely due to an error in how you are linking to the CSS file. To fix it, go into the source for the homepage (http://fblikes.x10.bz/) and change:
<link rel="stylesheet" href="styles.css">
To
<link rel="stylesheet" href="/styles.css">
 

spam.aniket88

New Member
Messages
6
Reaction score
0
Points
0
Nooooo...its redirecting to a wrong page..I told it earlier also. As you said I did the css and got the page looking perfectly fine...but still its a wrong page.(so I am changing it back, as it was)

All the links on http://fblikes.x10.bz/joomla/ getting redirected to http://fblikes.x10.bz/ which is wrong redirection.

When they will redirect correctly, all will show a Web Directory coz thats what those plugins are for and I want seo friendly urls.
 

spam.aniket88

New Member
Messages
6
Reaction score
0
Points
0
its a wrong redirection...i said earlier..doing the css displays that page perfectly but thats a wrong page..& wrong redirection

All links in that page redirect to fblikes home.

They should redirect to a web directory and should not leave joomla template.

Also only urls should be affected in /joomla directory coz thats where .htaccess & installation of script is.
 
Status
Not open for further replies.
Top