Not able to locate files

My designer has used friendly urls in the coding and therefore I am not able to locate few files
eg
heavy-collision-repair
auto-dent-removal etc

here is code

 <?php foreach ($services as $serv) { 

                            if($serv['friendly_url']=='auto-repair-removal-services' || $serv['friendly_url']=='heavy-collision-repair'){ ?>

                                  <div class="featured-service">

                                    <img class="img-responsive" src="inc/scale.php?src=../assets/img/_db/<?php echo $serv['banner_feat'] ?>&w=410&h=120&a=b" alt="">

                                    <a class="overlay" href="services/<?php echo $serv['friendly_url'] ?>">

                                        <span><?php echo $serv['title'] ?></span>

                                    </a>

                                  </div>  

                                <?php }} ?> 

                </div>

these URLs may be pre-processed by e.g. an entry in the .htaccess file, and then go to a router.

Pls also let me know the path where these pages are located

rimclinicmiami.com/services/heavy-collision-repair
rimclinicmiami.com/services/auto-dent-removal
rimclinicmiami.com/services/auto-repair-removal-services
rimclinicmiami.com/services/auto-paint-repair
rimclinicmiami.com/services/paintless-dent-repair

here is htaccess coding

RewriteRule ^about-us/?$ about.php [L]
  RewriteRule ^photos/?$ photos.php [L]
  RewriteRule ^reviews/?$ reviews.php [L]
  RewriteRule ^online-specials/?$ online-specials.php [L]
  RewriteRule ^contact-us/?$ contact.php [L]
  RewriteRule ^services/?$ services-full.php [L]
  RewriteRule ^services/([^/\.]+)/?$ services.php?id=$1 [L]
  RewriteRule ^services/?$ services.php [L]
  RewriteRule ^blog/([^/\.]+)/?$ post.php?id=$1 [L]
  RewriteRule ^blog/page/([^/\.]+)/?$ blog.php?page=$1 [L]
  RewriteRule ^blog/?$ blog.php [L] 
  ErrorDocument 404 /404.php

the destination file the request will be linked to is defined by the rewrite-rule. All you have to do is take your URL and apply the regluar expressions on it, the first match is your file. From there it’s up to the routers implementation and configuration what else is loaded.

But I am not able to find these files thru FTP

rimclinicmiami.com/services/heavy-collision-repair
rimclinicmiami.com/services/auto-dent-removal
rimclinicmiami.com/services/auto-repair-removal-services
rimclinicmiami.com/services/auto-paint-repair
rimclinicmiami.com/services/paintless-dent-repair

Is there any way to search specific text in entire site thru filezila or dreamweaver

What you have are not files, that’s only URLs. The files are specified within the .htaccess, according to the regex that follows the keyword “RewriteRule”. Just take a tutorial about mod_rewrite.

OK then from where I should modify content of these pages

 http://rimclinicmiami.com/services/heavy-collision-repair
 http://rimclinicmiami.com/services/auto-dent-removal
 http://rimclinicmiami.com/services/auto-repair-removal-services
 http://rimclinicmiami.com/services/auto-paint-repair
 http://rimclinicmiami.com/services/paintless-dent-repair

from that file your content management system requires you to change this data, the file that you located applying the rules within the htaccess on the targeted URL.

I have also searched the file in database but not able to find it, please help

and what insights did you get from the actual file you determined by apllying the regex from the htaccess on the URL? which file name did you get?

I don’t know much about .htaccess, and it’s not really a PHP topic, but I suspect that @chorn is suggesting that you look at that file, interpret the rules in it, to decide which file you should examine. For example, I suspect that the line

 RewriteRule ^services/?$ services-full.php [L]

looks at the incoming URL, sees that it has the word “services” at the end, and redirects to the file services-full.php. Similarly the next rule in sequence

RewriteRule ^services/([^/\.]+)/?$ services.php?id=$1 [L]

looks for services followed by something, parses that “something” into a variable called $1, and passes that in to services.php as the id parameter. If neither of those match, then the next line

RewriteRule ^services/?$ services.php [L]

looks for anything else containing services, and sends it to services.php with no parameters.

There’s plenty of documentation on .htaccess and rewrite rules around the web, come back if you have any further queries on it. Someone who actually knows about it may be able to help.

3 Likes

there are files services.php and services-full.php

and here is their rewrite rules

  RewriteRule ^services/?$ services-full.php [L]
  RewriteRule ^services/([^/\.]+)/?$ services.php?id=$1 [L]
  RewriteRule ^services/?$ services.php [L]

Can I share you the complete code of services.php?

Pls help me in finding these

http://rimclinicmiami.com/services/heavy-collision-repair
http://rimclinicmiami.com/services/auto-dent-removal
http://rimclinicmiami.com/services/auto-repair-removal-services
http://rimclinicmiami.com/services/auto-paint-repair
http://rimclinicmiami.com/services/paintless-dent-repair

So you have finally found the files to your URL. Whats the problem within these files now that you think about sharing any code? what have you tried to get to the core of the problem by yourself and what kind of help do you expect by sharing the code?

Surely as those URLs all have services contained in them, they will all be redirected to services.php and the id parameter (as $_GET['id']) will contain things like “heavy-collision-repair”, “auto-dent-removal” and so on? So you’ve found the file(s) you need.

But files are not in FTP… Do I have to search database to modify these? If yes then please let me know how

if there’s no file like services.php you are looking at the wrong place.

You’ve found out now that your rewrite rules take those URLs, and redirect to services.php and provide the last bit of the URL as a parameter to it. If you’ve found services.php, which you must have as you offered to share the code of it, then you’ve found the file. How each of those URLs is handled is within services.php.

services.php is there but I am not able to locate these

 http://rimclinicmiami.com/services/heavy-collision-repair
 http://rimclinicmiami.com/services/auto-dent-removal
 http://rimclinicmiami.com/services/auto-repair-removal-services
 http://rimclinicmiami.com/services/auto-paint-repair
 http://rimclinicmiami.com/services/paintless-dent-repair

I have also reviewed content of services.php

You won’t locate them, they are not files. They are handled in services.php according to your .htaccess file.

But then how to modify their content. I do not find these urls content in services.php