Jump to content

jimfog

Members
  • Posts

    1,803
  • Joined

  • Last visited

Everything posted by jimfog

  1. Is there any other way to grab the stub besides a htaccess rewriting?Htaccess is a mess.
  2. yes I am using relative URL's...I tried prepending a slash,as you said but for all the JS files I get 404 in the console.
  3. I have come to understand what the problem is.This is my htaccess now...with all the changes suggested: RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^blog_show/(.*)$ blog_show.php/?t=$1 [NC,L] The problem persists though...
  4. Ι do not understand. First of all what these RewriteCond statements do? You also say that the URL is not of an existing file/dir. If that is the case how the rewrite rule must be....if not of an existing file/dir? Cause you say also that there must be a rewriteRule statement.
  5. The head section in one of my webpages has links to various JS files/plugins: <script src="js/jquery-1.11.1.min.js" ></script> <script src="js/jquery.validate.js" ></script> <script src="js/jquery-ui 1.11.2.js"></script> <script src="js/jquery.bootpag.min.js" ></script> <script src="js/footer.js" ></script> <script src="js/html-inspector.js" ></script> All the above in the following page:http://localhost/Appointments/Frontend/blog_show.php In my htaccess file I have this rule: RewriteRule ^blog_show/(.*)$ blog_show.php/?t=$1 [NC,L] So rewriting takes place when the user types this in the web address bar: http://localhost/Appointments/Frontend/blog_show/2016-07-28/ blog_show.php is called again but with a query string and here the problem appears. The js files/plugins do not load correctly...the console emit this error: https://onedrive.live.com/redir?resid=BE27434B2AAC8130!456&authkey=!ABzaukrkGCA9W80&v=3&ithint=photo%2cPNG I do not have the slightest idea why this happens...
  6. At last we have arrived at the most important part of the topic. So,you are saying that a URL stub is stored in the database. If that stub comprises of the date and the title,then this is exactly what I intend to do. Everything else you mention about an htaccess rule pointing to a PHP script that will "grab" the stub is precisely what I am doing here. If the above is indeed the case I do not see how my approach is wrong. In my case,also, the stub is the date and the title.Combining these two, an article may be uniquely identified. I mean how possible is the case that tho articles have the same date and title.
  7. Τhe user will be able to see only one full article at a time...I do not see how this is a constraint. Exactly in the way it is done here https://taxibeat.com/blog/.
  8. Ι think that a good alternative to ID is the date...I am going to use this for uniquely identifying a blog article.
  9. what example? Sorry...I am just a little confused,many posts for this topic.
  10. The ID is hidden in the browser address bar but what about the HTML..the href tag? The link the user is about to click.
  11. let me comment on the above... You saying that the URL in the link will have an ID and then this will be converted to a friendly URL.I got that... But the ID is exposed in the HTML source...isn't that a security vulnerability? (The idea for a friendly URL from the beginning(with no IDs) as I said I got it from here https://taxibeat.com/) Now one last thing....as I understand if we have two links about a corresponding number of blog posts...both of these will have corresponding IDs. Yes but dont'we need a different rewrite rule for every article/ugly URL in htaccess? You had answered no...well give me example how one rewrite rule can cover every possible different link(with different IDs each) .
  12. Οk I got your point...nonetheless you must give me an example of how a friendly URL can lead to an URL with an ID. Theory is good but an example would be better.
  13. anyway...you are proposing to use an ID. I still cannot understand how to associate a unique title with an ID. You have to give me an example.
  14. if ingolme is correct then there is no need for an ID.Just take a look at ingol,mes post.
  15. just take a read more links here https://taxibeat.com/blog/ ...they are friendly either way(if you look at the HTML source) I just want to rewrite it to an ugly form like the one ingolme mentions in post 44...and then based on the title retrieve the article from the database. I will not use an ID as an identifier,there is no need for it,just the title. At least this option seems viable...
  16. here is the friendly URL now of a blog post: http://localhost/Appointments/Frontend/blog_dtl/genga.php The above is what the user sees in the address bar....I want the above to be rewritten in http://localhost/Appointments/Frontend/blog_dtl/t=genga.php ...so I can grab genga(which is the title of the article) and based on it retrieve the article from the Database. That is the rationale here...I do not know what kind of rewrite rule would that here.
  17. Ok I need some help with it....how am I going to achieve that? It must not be difficult.
  18. hhhhmm...that is very interesting and probably the solution to my problem.
  19. I got it. And now here is the important conclusion. Since my intention is to have friendly URLs which lead ti ugly with an ID(so I can retrieve the blog article from the DB)....that means one thing: Making an entry in htaccess for every blog article....impractical....necessary though. Is my above thought correct?
  20. Where are you referring to?
  21. all these are good but I have not figured out how they fit in my case: A friendly URL link of a blog post that leads to a URL with an ID based on which I will search the db for the blog article. Of course the friendly URL is always shown in the address bar....but somehow this must lead to a page where I can process the ID. To be honest....I do not know even if that is possible the way I describe it.
  22. what exactly are you trying to achieve in post 13 Dsonesuk?
  23. mod rewrite... From the beginning this was the goal...and still is.
  24. believe it or not...I finally made it working.I followed this tutorial http://dk.co.nz/seo I implemented a rewrite rule...now I want to test the redirection also.
  25. again...where is the roor dir from the folders depicted in the image? the image:https://onedrive.live.com/redir?resid=BE27434B2AAC8130!454&authkey=!AO71ww8Tkksk6hc&v=3&ithint=photo%2cPNG My progect files are located inside Appointments and from there other directories are found...frontend for instance is inside of it.
×
×
  • Create New...