Topic: Rewrite Issue

So, I tried to use the rewrite thing for the url. I got it to work.

However, when you go to the article the comment form disappears, but only if I have the rewrite option on. No idea why.

Any suggestions?

Re: Rewrite Issue

So, I tried to use the rewrite thing for the url. I got it to work.

However, when you go to the article the comment form disappears, but only if I have the rewrite option on. No idea why.

Any suggestions?

Hello Maroon Caludin,

Please inform us about your CuteNews version and the requested URL, where the comment form disappears, for example "/news/5.html". Please enclose the News screenshot.

Best regards,
CN Support team

3 (edited by Maroon Caludin 2016-07-05 21:46:19)

Re: Rewrite Issue

I had disabled it since it wasn't working. I tried it again, but now when you click on a post it won't let you go to it. It just reloads the page showing all the entries.

Also using the current version.

Re: Rewrite Issue

Hello Maroon Caludin,

Please copy and paste your .htaccess settings here on forum for better understanding. It is also necessary to check the  Dashboard > System configurations fields settings:

1 Use rewrite engine
2 Rewrite prefix

and make sure everything is ok with the server directories.

Best regards,
CN Support team

Re: Rewrite Issue

Support_Team wrote:

Hello Maroon Caludin,

Please copy and paste your .htaccess settings here on forum for better understanding. It is also necessary to check the  Dashboard > System configurations fields settings:

1 Use rewrite engine
2 Rewrite prefix

and make sure everything is ok with the server directories.

Here's the cuteness part of the .htaccess.

# --- CUTENEWS[ST]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ /cutenews/show_news.php?cn_rewrite_url=$1 [L]
# --- CUTENEWS[ED]

And my settings in the dashboard for the rewrite are:

Real Path to Layout File: PATHTO/cutenews/example.php
Rewrite Prefix: /news/

I wasn't sure if the real path to layout file needed to be changed. That part did confuse me.

Re: Rewrite Issue

Any ideas?

Re: Rewrite Issue

I have this problem too. It says "Cannot find an article with id: " with"Use rewrite engine" checked.

Otherwise, it works normaly.

My settings:
_____________________

# --- CUTENEWS[ST]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ /cutenews_videos/show_news.php?cn_rewrite_url=$1 [L]
# --- CUTENEWS[ED]

Use rewrite engine - Checked
Real path to your layout file - "(serverdirectory)/cutenews_videos/example.php"
Rewrite prefix - "/"

What is the meaning of "Real path to your layout file"? I changed to index.php and still doesnt work.

Re: Rewrite Issue

I think I found a solution but its not the good way to fix this bug.

core.php line 3849

I changed from
        elseif (preg_match('/\/([0-9a-z_\-\.]+)'.$post_fix.'/i', $cn_rewrite_url, $c))
to
        elseif (preg_match('/\/([0-9a-z_\-\.]+).php/i', $cn_rewrite_url, $c))

I dont know if the problem is related with ".php" in URL. Can you check it Support_Team?

Re: Rewrite Issue

gemifra wrote:

I think I found a solution but its not the good way to fix this bug.

core.php line 3849

I changed from
        elseif (preg_match('/\/([0-9a-z_\-\.]+)'.$post_fix.'/i', $cn_rewrite_url, $c))
to
        elseif (preg_match('/\/([0-9a-z_\-\.]+).php/i', $cn_rewrite_url, $c))

I dont know if the problem is related with ".php" in URL. Can you check it Support_Team?

Dear User,

The described behavior is not typical for rewriting. It can be supposed that you use a PHP file for rewriting, while the file doesn't exist on server. The .php extension should be removed from the links. The address URL should look like in the example below:

/cutenews_videos/example
Best regards,
CN Support team