404 error when URL rewriting enabled

Discuss Search Engine Optimization in relation to Joomla! 2.5. This forum will also have discussions on SEF/SEO Joomla! 2.5 extensions.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Locked
Sundog108
Joomla! Apprentice
Joomla! Apprentice
Posts: 13
Joined: Thu Mar 22, 2012 4:42 pm

404 error when URL rewriting enabled

Post by Sundog108 » Thu Jan 17, 2013 7:50 pm

Hi,

In SEO settings, I've enabled Search Engine Friendly URL's - that's fine
But when enable "Use URL rewriting" I get the 404 error on all pages except my home page.

Here's what I'm using:
Joomla 2.5 / Apache/
My site is: http://184.173.232.39/~lee/
this is my temporary domain - perhaps using a temp domain is causing problems?
permanent domain will be: www.vigrahasacredart.com

Here's what I've tried:

- I have renamed htaccess.txt to .htaccess

- I have tried uncommenting this line in my .htaccess file:
Options +FollowSymLinks
(still got 404 error)

- I have placed this code into my .htaccess filer per Joomla docs:
RewriteRule ^joomla\.html http://www.joomla.org/? [R=301,L]
then I put the following into my browser:
http://www.example.com/joomla.html - and replaced "example" with my temp domain (404 error) and then tried with the permanent one (still 404 error).

I have also uncommented this line:
RewriteBase /
still no good.

I've tried so many things I'm a bit lost at this point. HELP!
This is what my .htaccess file looks like now:

## 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!
#
# Block out any script trying to base64_encode data within the URL.
RewriteCond %{QUERY_STRING} base64_encode[^(]*\([^)]*\) [OR]
# Block out any script that includes a <script> tag in URL.
RewriteCond %{QUERY_STRING} (<|%3C)([^s]*s)+cript.*(>|%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})
# Return 403 Forbidden header and show the content of the root homepage
RewriteRule .* index.php [F]
#
## End - Rewrite rules to block out some common exploits.

## Begin - Custom redirects
#
# If you need to redirect some pages, or set a canonical non-www to
# www redirect (or vice versa), place that code here. Ensure those
# redirects use the correct RewriteRule syntax and the [R=301,L] flags.
#
## End - Custom redirects

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

RewriteBase /

## Begin - Joomla! core SEF Section.
#
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
#
# If the requested path and file is not /index.php and the request
# has not already been internally rewritten to the index.php script
RewriteCond %{REQUEST_URI} !^/index\.php
# and the request is for something within the component folder,
# or for the site root, or for an extensionless URL, or the
# requested URL ends with one of the listed extensions
RewriteCond %{REQUEST_URI} /component/|(/[^.]*|\.(php|html?|feed|pdf|vcf|raw))$ [NC]
# and the requested path and file doesn't directly match a physical file
RewriteCond %{REQUEST_FILENAME} !-f
# and the requested path and file doesn't directly match a physical folder
RewriteCond %{REQUEST_FILENAME} !-d
# internally rewrite the request to the index.php script
RewriteRule .* index.php [L]
#
## End - Joomla! core SEF Section.


Would love to remove the index.php from my browser. At present if I want to see more than the home page I have to switch URL rewriting to "no."

Any help greatly appreciated! :)

User avatar
bewebdev
Joomla! Ace
Joomla! Ace
Posts: 1017
Joined: Tue Apr 17, 2012 11:28 am
Location: Lincolnshire, UK

Re: 404 error when URL rewriting enabled

Post by bewebdev » Thu Jan 17, 2013 9:23 pm

Sundog108

Does you hosting support mod_rewrite, without it wont work, no matter what changes you make to the htaccess file?

regards

@bewebdev ^AW
Joomla & Magento Specialists.
white label web talent
http://www.missingmojo.co.uk

User avatar
Per Yngve Berg
Joomla! Master
Joomla! Master
Posts: 25171
Joined: Mon Oct 27, 2008 9:27 pm
Location: Akershus, Norway

Re: 404 error when URL rewriting enabled

Post by Per Yngve Berg » Thu Jan 17, 2013 9:24 pm

It does not work with an ip address. Wait until you get a proper domain.

Sundog108
Joomla! Apprentice
Joomla! Apprentice
Posts: 13
Joined: Thu Mar 22, 2012 4:42 pm

Re: 404 error when URL rewriting enabled

Post by Sundog108 » Thu Jan 17, 2013 10:17 pm

Thank you for the replies. Hosting is hostgator, who does support mod_rewrite.

If it won't work with my temp ip address, that would answer it. I guess I'll have to wait till I'm ready for the proper domain name.


Locked

Return to “Search Engine Optimization (Joomla! SEO) in Joomla! 2.5”