Pretty URLs again!

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Locked
learn

Pretty URLs again!

Post by learn »

I'm sorry to bother you with a Pretty URLS-Problem again. Yes, I have read all the Board-Entries referrring to this topic but found nothing helpful.

So, what is the problem?:
When clicking on a link or entering an adress manually (Pretty URLs is of course activated) I get an 404 error message.

My config.php:
#Show mod_rewrite URLs in the menu?
$config['assume_mod_rewrite'] = true;

#Extension to use if you're using mod_rewrite for pretty URLs.
$config['page_extension'] = '/';

#If you don't use mod_rewrite, then would you like to use the built-in
#pretty url mechanism?  This will not work with IIS and the {metadata} tag
#should be in all of your templates before enabling.
$config['internal_pretty_urls'] = false;

#If you're using the internal pretty url mechanism or mod_rewrite, would you like to
#show urls in their hierarchy?  (ex. http://www.mysite.com/parent/parent/childpage)
$config['use_hierarchy'] = true;

#If using none of the above options, what should we be using for the query string
#variable?  (ex. http://www.mysite.com/index.php?page=somecontent)
$config['query_var'] = 'page';
My .htaccess:
Options +FollowSymLinks
RewriteEngine on
RewriteBase /

# 301 Redirect all requests that don't contain a dot or trailing slash to
# include a trailing slash
RewriteCond %{REQUEST_URI} !/$
RewriteCond %{REQUEST_URI} !\.
RewriteRule ^(.*) %{REQUEST_URI}/ [R=301,L]

# Rewrites urls in the form of /parent/child/
# but only rewrites if the requested URL is not a file or directory
RewriteCond %{REQUEST_FILENAME} !-f [NC]
RewriteCond %{REQUEST_FILENAME} !-d [NC]
RewriteRule ^(.+)$ neue_GJD-Netzseite/jugend/index.php?page=$1 [QSA]
The base-tag is set correctly in my template.

The site is running undern an local Apache Server under Ubuntu Linux. The site is working without problems except for the Pretty URLs. RewriteModule is installed and working: I'm running Wordpress with PU without problems.

I don't if it is of importance or not. The template is a html-file which I am including using the {include}-tag as explained here somewhere in the forum.

Can anybody help.? I have not the faintest idea what is wrong.
User avatar
Elijah Lofgren
Power Poster
Power Poster
Posts: 811
Joined: Mon Apr 24, 2006 1:01 am

Re: Pretty URLs again!

Post by Elijah Lofgren »

learn wrote: I'm sorry to bother you with a Pretty URLS-Problem again. Yes, I have read all the Board-Entries referrring to this topic but found nothing helpful.

So, what is the problem?:
When clicking on a link or entering an adress manually (Pretty URLs is of course activated) I get an 404 error message.

...

My .htaccess:
...
RewriteRule ^(.+)$ neue_GJD-Netzseite/jugend/index.php?page=$1 [QSA]
Hmm...
I would try replacing that line in your .htaccess with this line:

Code: Select all

RewriteRule ^(.+)$ index.php?page=$1 [QSA]
learn wrote: The site is running undern an local Apache Server under Ubuntu Linux.
I'm running a local test server using Ubuntu 6.06 and I use this .htaccess file:

Code: Select all

Options +FollowSymLinks
RewriteEngine on

# 301 Redirect all requests that don't contain a dot or trailing slash to
# include a trailing slash
RewriteCond %{REQUEST_URI} !/$
RewriteCond %{REQUEST_URI} !\.
RewriteRule ^(.*) %{REQUEST_URI}/ [R=301,L]

# Rewrites urls in the form of /parent/child/
# but only rewrites if the requested URL is not a file or directory
RewriteCond %{REQUEST_FILENAME} !-f [NC]
RewriteCond %{REQUEST_FILENAME} !-d [NC]
RewriteRule ^(.+)$ index.php?page=$1 [QSA]
Hope this helps,

Elijah
Note: I don't have time to take on any more projects. I'm quite busy. I may be too busy to reply to emails or messages. Thanks for your understanding. :)
learn

Re: Pretty URLs again!

Post by learn »

Nah, unfortunately it doesn't help. I put the
RewriteRule ^(.+)$ neue_GJD-Netzseite/jugend/index.php?page=$1 [QSA]
into the .htaccess, because it said somewhere in the docs that I should do this if my cms is in a subdirectory. The structure is the following: /var/www/neue_GJD-Netzseite/jugend/. i renamed the cmsmadesimple-folder to "jugend", so that's where all the stuff is.

Another question:
I put the .htaccess into "jugend". Is that ok? I did it that way because later on when the webpage will be online it's in a subfolder and I don't want to cause problems with the main .htaccess.
User avatar
Elijah Lofgren
Power Poster
Power Poster
Posts: 811
Joined: Mon Apr 24, 2006 1:01 am

Re: Pretty URLs again!

Post by Elijah Lofgren »

learn wrote: Nah, unfortunately it doesn't help. I put the
RewriteRule ^(.+)$ neue_GJD-Netzseite/jugend/index.php?page=$1 [QSA]
into the .htaccess, because it said somewhere in the docs that I should do this if my cms is in a subdirectory. The structure is the following: /var/www/neue_GJD-Netzseite/jugend/. i renamed the cmsmadesimple-folder to "jugend", so that's where all the stuff is.

Another question:
I put the .htaccess into "jugend". Is that ok? I did it that way because later on when the webpage will be online it's in a subfolder and I don't want to cause problems with the main .htaccess.
I just did a test install of CMSMS into /var/www/neue_GJD-Netzseite/jugend/ and pretty URLs work fine with the .htaccess file that you pasted earlier being put at /var/www/neue_GJD-Netzseite/jugend/.htaccess

For example, URLs like http://localhost/neue_GJD-Netzseite/jug ... s/navleft/ work.

Are you sure that everything is working with pretty URLS off? On CMSMS 0.13 a 404 error will be shown if the database connection info is wrong.

Does the following URL work for you? http://localhost/neue_GJD-Netzseite/jug ... ge=navleft

Hopefully, we can narrow down the problem and find a solution.
Note: I don't have time to take on any more projects. I'm quite busy. I may be too busy to reply to emails or messages. Thanks for your understanding. :)
learn

Re: Pretty URLs again!

Post by learn »

Hey,
first let me thank for your efforts so far. Now, I tried some things out. The page is working correctly using the normal php-Urls or Internal Pretty URLs. I even thought, "maybe it's the template". But nope, it isn't. So what can I say? I'm pretty sure by now that it's a ModRewrite problem. Maybe CMSMS is not working correctly with RewriteModule. I gonna trie to test the page on antoher computer (also this will be some effort). So if it turns out that it's my computer-specific problem, than I don't really have a problem the page is going to run on a (real) server anyway. So cross your fingers for me.
Locked

Return to “CMSMS Core”