valepu
valepu

Reputation: 3315

Mod Rewrite: links being rewritten but not found

I am trying to use TYPO3 on a WAMP system but i'm having problems with the rewritten URLs. I have installed the introduction package which has a "get-started" website. Everytime i try to access the website through one of these: localhost/typo3 localhost/typo3/index.php localhost/typo3/index.php/get-started

the url becomes localhost/typo3/get-started

Which is okay and it means mod_rewrite is on and working. The problem is that i can't see the site localhost/typo3/get-started and i have an "Object not found" page instead.

I have the same issue on the same machine with Symfony 1.4 but i never cared about that because on Symfony i can use the frontend_dev.php page to access the site (on my production environment rewritten URLs work fine instead).

This is the httpd.conf entry for the TYPO3 directory:

Alias /typo3 "C:\workspace\typo3"
<Directory "C:\workspace\typo3">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
Allow from all
</Directory>

And this is the .htaccess file (which was already inside the TYPO3 package and i haven't modified), i have removed the non related parts

### Begin: Settings for mod_rewrite ###

# You need rewriting, if you use a URL-Rewriting extension (RealURL, CoolUri, SimulateStatic).

<IfModule mod_rewrite.c>

# Enable URL rewriting
RewriteEngine On

# Change this path, if your TYPO3 installation is located in a subdirectory of the website root.
#RewriteBase /

# Rule for versioned static files, configured through:
# - $TYPO3_CONF_VARS['BE']['versionNumberInFilename']
# - $TYPO3_CONF_VARS['FE']['versionNumberInFilename']
# IMPORTANT: This rule has to be the very first RewriteCond in order to work!
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)\.(\d+)\.(php|js|css|png|jpg|gif|gzip)$ $1.$3 [L]

# Stop rewrite processing, if we are in the typo3/ directory.
# For httpd.conf, use this line instead of the next one:
# RewriteRule ^/TYPO3root/(typo3/|t3lib/|fileadmin/|typo3conf/|typo3temp/|uploads/|favicon\.ico) - [L]
RewriteRule ^(typo3/|t3lib/|fileadmin/|typo3conf/|typo3temp/|uploads/|favicon\.ico) - [L]

# Redirect http://example.com/typo3 to http://example.com/typo3/index_re.php and stop the rewrite processing.
# For httpd.conf, use this line instead of the next one:
# RewriteRule ^/TYPO3root/typo3$ /TYPO3root/typo3/index.php [L]
RewriteRule ^typo3$ typo3/index_re.php [L]

# If the file/symlink/directory does not exist => Redirect to index.php.
# For httpd.conf, you need to prefix each '%{REQUEST_FILENAME}' with '%{DOCUMENT_ROOT}'.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l

# Main URL rewriting.
# For httpd.conf, use this line instead of the next one:
# RewriteRule .* /TYPO3root/index.php [L]
RewriteRule .* index.php [L]

</IfModule>

### End: Settings for mod_rewrite ###

Upvotes: 0

Views: 2056

Answers (2)

pgampe
pgampe

Reputation: 4578

You should change the #RewriteBase / to RewriteBase /typo3/ as described inside the .htaccess file.

Upvotes: 1

valepu
valepu

Reputation: 3315

Solved, the problem was on the easyphp settings because i wasn't using its DocumentRoot (but just using aliases), changing the DocumentRoot to the one where i keep my projects solved it

Upvotes: 2

Related Questions