We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

After removing index.php settings now on news channel shows invalid url

How Do I?

weblizzer's avatar
weblizzer
15 posts
10 years ago
weblizzer's avatar weblizzer

I just remove the index.php using the htaccess followed the documentation

I’m usin the v2.9.3

I also set on Cp Home > Admin > Global Configuration

Name of your site’s index page = (empty) URL to the root directory of your site = http://www.mysite.com/

Now when i browse

http://www.mysite.com/news

Since i made a list then add read more link for every news..

what i see is http://www.mysite.com/mysite.com/news/article-content

as I check the link in page source it the links shows <a href=”mysite.com/news/article-content”> on the tag. How can I add http:// in all the links? this same happen on pagination as well as when i try to implement a simple search.

Please advise thanks

       
jondaiello's avatar
jondaiello
15 posts
10 years ago
jondaiello's avatar jondaiello

What tag are you using to generate the ‘read more’ URL in your template?

       
weblizzer's avatar
weblizzer
15 posts
10 years ago
weblizzer's avatar weblizzer

here is the script

{exp:channel:entries channel="news" paginate_base="news" limit="3"}

{title}

            By {author}
            {news_body}

      <a href="http://{url_title_path=news}">Read more</a>

{paginate }
  Page {current_page} of {total_pages} pages {pagination_links}
{/paginate}

{/exp:channel:entries}

Here is the .htaccess <IfModule mod_rewrite.c> RewriteEngine On RewriteBase /

    # Removes index.php from ExpressionEngine URLs
    RewriteCond %{THE_REQUEST} ^GET.*index\.php [NC]
    RewriteCond %{REQUEST_URI} !/system/.* [NC]
    RewriteRule (.*?)index\.php/*(.*) /$1$2 [R=301,NE,L]

    # Directs all EE web requests through the site index file
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ /index.php/$1 [L]

</IfModule>

       
jondaiello's avatar
jondaiello
15 posts
10 years ago
jondaiello's avatar jondaiello

Instead of using:

<a href="http://{url_title_path=news}">Read more</a>

Try:

<a href="http://{title_permalink=news}">Read more</a>
       
weblizzer's avatar
weblizzer
15 posts
10 years ago
weblizzer's avatar weblizzer

I already tried this one but still the same.. and it also appears in pagination links as well as on the search. is this something to do with the config or database?

       
jondaiello's avatar
jondaiello
15 posts
10 years ago
jondaiello's avatar jondaiello

Can you post your channel configs for this channel?

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.