4 Replies - 3072 Views - Last Post: 16 March 2013 - 04:14 PM

#1 Joshdw  Icon User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 225
  • Joined: 23-March 09

Can't figure out this URL problem

Posted 11 March 2013 - 09:26 AM

Hello DiC'ers, once again, sorry!
I am having trouble finding the cause of the problem at the moment, I was wondering if someone could guide me on the right path to figure it out.

I am using this code in my htaccess file to remove the extensions of PHP files (well any files) because, who wouldn't...
/*Some other stuff*/
Options +FollowSymlinks -MultiViews
RewriteEngine On
RewriteCond %{THE_REQUEST} ^GET\s(.*/)index\.php [NC]
RewriteRule . %1 [NE,R=301,L]
RewriteCond %{THE_REQUEST} ^GET\s.+\.php [NC]
RewriteRule ^(.+)\.php$ /$1 [NE,R=301,L,NC]
RewriteCond %{REQUEST_URI} !\.php$ [NC]
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule . %{REQUEST_URI}.php [L]


But the problem is, the url for example, domain/en/properties works perfectly fine, but domain/en//properties still seems to output the website, but all of the linked sources, that are for example, like a css file located at "../css.style.css" won't show because the directory isn't the same.
I am quite confused as to why this happens, could anyone help me?

I used the above code after trying my original one (that worked with XAMPP, but when uploading it to the host, didn't work, which was the following):
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.php [NC]


So if anyone could also find the time to explain why the above code worked, but not the below one, I would highly appreciate it!

Is This A Good Question/Topic? 0
  • +

Replies To: Can't figure out this URL problem

#2 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 6058
  • View blog
  • Posts: 23,495
  • Joined: 23-August 08

Re: Can't figure out this URL problem

Posted 11 March 2013 - 09:31 AM

Not a PHP question, so moved to Web Servers & Hosting forum.
Was This Post Helpful? 0
  • +
  • -

#3 Joshdw  Icon User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 225
  • Joined: 23-March 09

Re: Can't figure out this URL problem

Posted 11 March 2013 - 09:33 AM

Ah okey, my bad! Sorry
Was This Post Helpful? 0
  • +
  • -

#4 galtech  Icon User is offline

  • New D.I.C Head
  • member icon

Reputation: 3
  • View blog
  • Posts: 13
  • Joined: 16-March 13

Re: Can't figure out this URL problem

Posted 16 March 2013 - 03:57 PM

Hi Joshdw,

I'm just trying to understand the issue you are having. It appears instead of your site displaying at the address "domain/en/properties", it is displaying at this address "domain/en//properties". Would that be right?

Could you tell me if you are using a CMS and if so which one?

regards,

galtech
Was This Post Helpful? 0
  • +
  • -

#5 Joshdw  Icon User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 225
  • Joined: 23-March 09

Re: Can't figure out this URL problem

Posted 16 March 2013 - 04:14 PM

Hey galtech,
sorry, that is not what is happening. The pages display correctly, there's nothing wrong with them. The problem I am having that the page still displays when I add another / to a subfolder, for example:
domain/de/about displays correctly
but if for some reason you type in:
domain/de//about, the page still displays the correct file, but images or css code that is in the html like "../" won't display correctly, as it appears that it thinks it's in another subfolder maybe?

As for the cms, I am not actually using any cms, I made my own simple php mysql function that depending on the language, displays one text or another.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1